slint-ui
Version:
Slint is a declarative GUI toolkit to build native user interfaces for desktop and embedded applications.
360 lines (359 loc) • 13.8 kB
JavaScript
"use strict";
// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
Object.defineProperty(exports, "__esModule", { value: true });
exports.language = void 0;
// AUTO-GENERATED by api/node/build.rs from internal/common/enums.rs
// and internal/common/builtin_structs.rs. Do not edit.
const binding_cjs_1 = require("../../binding.cjs");
const _data = {
/**
* The enum reports what happened to the `PointerEventButton` in the event
*/
PointerEventKind: {
/**
* The action was cancelled.
*/
Cancel: "cancel",
/**
* The button was pressed.
*/
Down: "down",
/**
* The button was released.
*/
Up: "up",
/**
* The pointer has moved,
*/
Move: "move",
},
/**
* This enum describes the different types of buttons for a pointer event,
* typically on a mouse or a pencil.
*/
PointerEventButton: {
/**
* A button that is none of left, right, middle, back or forward. For example,
* this is used for the task button on a mouse with many buttons.
*/
Other: "other",
/**
* The left button.
*/
Left: "left",
/**
* The right button.
*/
Right: "right",
/**
* The center button.
*/
Middle: "middle",
/**
* The back button.
*/
Back: "back",
/**
* The forward button.
*/
Forward: "forward",
},
/**
* This enum represents the different values for the `accessible-role` property, used to describe the
* role of an element in the context of assistive technology such as screen readers.
*
* In addition to widget roles, this enum includes *landmark* roles (`banner`, `complementary`,
* `content-info`, `form`, `main`, `navigation`, `region`, `search`).
* Landmarks identify large content areas that screen reader users can jump between,
* giving the application a navigable structure similar to headings in a document.
* See [WAI-ARIA Landmark Regions](https://www.w3.org/WAI/ARIA/apg/practices/landmark-regions/)
* for guidance on when and how to use them.
*/
AccessibleRole: {
/**
* The element isn't accessible.
*/
None: "none",
/**
* The element is a `Button` or behaves like one.
*/
Button: "button",
/**
* The element is a `CheckBox` or behaves like one.
*/
Checkbox: "checkbox",
/**
* The element is a `ComboBox` or behaves like one.
*/
Combobox: "combobox",
/**
* The element is a `GroupBox` or behaves like one.
*/
Groupbox: "groupbox",
/**
* The element is an `Image` or behaves like one. This is automatically applied to `Image` elements.
*/
Image: "image",
/**
* The element is a `ListView` or behaves like one.
*/
List: "list",
/**
* The element is a `Slider` or behaves like one.
*/
Slider: "slider",
/**
* The element is a `SpinBox` or behaves like one.
*/
Spinbox: "spinbox",
/**
* The element is a `Tab` or behaves like one.
*/
Tab: "tab",
/**
* The element is similar to the tab bar in a `TabWidget`.
*/
TabList: "tab-list",
/**
* The element is a container for tab content.
*/
TabPanel: "tab-panel",
/**
* The role for a `Text` element. This is automatically applied to `Text` elements.
*/
Text: "text",
/**
* The role for a `TableView` or behaves like one.
*/
Table: "table",
/**
* The role for a TreeView or behaves like one. (Not provided yet)
*/
Tree: "tree",
/**
* The element is a `ProgressIndicator` or behaves like one.
*/
ProgressIndicator: "progress-indicator",
/**
* The role for widget with editable text such as a `LineEdit` or a `TextEdit`.
* This is automatically applied to `TextInput` elements.
*/
TextInput: "text-input",
/**
* The element is a `Switch` or behaves like one.
*/
Switch: "switch",
/**
* The element is an item in a `ListView`.
*/
ListItem: "list-item",
/**
* The element is a `RadioButton` or behaves like one.
*/
RadioButton: "radio-button",
/**
* The element is a container grouping related `RadioButton`s.
*/
RadioGroup: "radio-group",
/**
* Landmark: the header area of the application, typically containing a logo, title, or global navigation.
*/
Banner: "banner",
/**
* Landmark: a supporting section that complements the main content, such as a sidebar.
*/
Complementary: "complementary",
/**
* Landmark: information about the application or its content, typically at the bottom (e.g. status bar, copyright).
*/
ContentInfo: "content-info",
/**
* Landmark: a region containing input fields and controls for submitting information.
*/
Form: "form",
/**
* Landmark: the primary content of the application. Each view should have exactly one `main` landmark.
*/
Main: "main",
/**
* Landmark: a group of links or controls used for navigating the application.
*/
Navigation: "navigation",
/**
* Landmark: a generic section significant enough to be listed in a summary.
* Use a more specific landmark if one applies.
*/
Region: "region",
/**
* Landmark: a region containing controls for searching or filtering content.
*/
Search: "search",
},
/**
* This enum represents the different values of the `accessible-live-region` property.
* It indicates that an element is a live region whose content changes should be
* announced by assistive technologies.
*/
AccessibleLiveness: {
/**
* Use in regions that present information that is of low-importance to the user.
* Assistive technologies are expected to not announce changes unless the user explicitly asks for it.
*/
Off: "off",
/**
* Use in regions that present new information to users.
* Assistive technologies are expected to not interrupt the user to inform of changes to the live region.
*/
Polite: "polite",
/**
* Use in regions that present information that a user should know about right away.
* Assistive technologies are expected to announce to the user as soon as possible.
*/
Assertive: "assertive",
},
/**
* This enum represents the different values of the `sort-order` property.
* It's used to sort a `StandardTableView` by a column.
*/
SortOrder: {
/**
* The column is unsorted.
*/
Unsorted: "unsorted",
/**
* The column is sorted in ascending order.
*/
Ascending: "ascending",
/**
* The column is sorted in descending order.
*/
Descending: "descending",
},
/**
* Represents the orientation of an element or widget such as the `Slider`.
*/
Orientation: {
/**
* Element is oriented horizontally.
*/
Horizontal: "horizontal",
/**
* Element is oriented vertically.
*/
Vertical: "vertical",
},
/**
* This enum indicates the color scheme used by the widget style. Use this to explicitly switch
* between dark and light schemes, or choose Unknown to fall back to the system default.
*/
ColorScheme: {
/**
* The scheme is not known and a system wide setting configures this. This could mean that
* the widgets are shown in a dark or light scheme, but it could also be a custom color scheme.
*/
Unknown: "unknown",
/**
* The style chooses light colors for the background and dark for the foreground.
*/
Dark: "dark",
/**
* The style chooses dark colors for the background and light for the foreground.
*/
Light: "light",
},
/**
* This enum describes the action negotiated between the source of a drag (`DragArea`)
* and its target (`DropArea`) during a drag-and-drop operation. The source declares
* which actions it permits, the target picks one in its `can-drop` callback, and the
* chosen action is reported back to the source via `drag-finished` so that, for
* example, a `move` source can remove the original data. The same enum is used for
* drags that come from another application or window once native drag-and-drop is
* in play.
*/
DragAction: {
/**
* No action: the drag is rejected, no drop will be delivered.
*/
None: "none",
/**
* The data is copied to the target; the source retains it.
*/
Copy: "copy",
/**
* The data is moved to the target; the source should remove it once the
* operation completes.
*/
Move: "move",
/**
* A link to the source data is created at the target; neither side gives
* up ownership.
*/
Link: "link",
},
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* The `KeyboardModifiers` struct provides booleans to indicate possible modifier keys on a keyboard, such as Shift, Control, etc.
* It is provided as part of `KeyEvent`'s `modifiers` field.
*
* Keyboard shortcuts on Apple platforms typically use the Command key (⌘), such as Command+C for "Copy". On other platforms
* the same shortcut is typically represented using Control+C. To make it easier to develop cross-platform applications, on macOS,
* Slint maps the Command key to the control modifier, and the Control key to the meta modifier.
*
* On Windows, the Windows key is mapped to the meta modifier.
*/
KeyboardModifiers: (props) => Object.freeze({ alt: false, control: false, shift: false, meta: false, ...props }),
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents a Pointer event sent by the windowing system.
* This structure is passed to the `pointer-event` callback of the `TouchArea` element.
*/
PointerEvent: (props) => Object.freeze({ button: "other", kind: "cancel", modifiers: _data.KeyboardModifiers(), touch_finger_id: 0, ...props }),
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents a Pointer scroll (or wheel) event sent by the windowing system.
* This structure is passed to the `scroll-event` callback of the `TouchArea` element.
*/
PointerScrollEvent: (props) => Object.freeze({ delta_x: 0, delta_y: 0, modifiers: _data.KeyboardModifiers(), ...props }),
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This structure is generated and passed to the key press and release callbacks of the `FocusScope` element.
*/
KeyEvent: (props) => Object.freeze({ text: "", modifiers: _data.KeyboardModifiers(), repeat: false, ...props }),
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This structure is passed to the callbacks of the `DropArea` element
*/
DropEvent: (props) => Object.freeze({ data: new binding_cjs_1.DataTransfer(), position: { x: 0, y: 0 }, proposed_action: "none", ...props }),
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* Represents an item in a StandardListView and a StandardTableView.
*/
StandardListViewItem: (props) => Object.freeze({ text: "", ...props }),
/**
* Build a value of this struct. Any field you omit takes a documented default,
* which lets Slint add fields later without breaking existing call-sites.
*
* This is used to define the column and the column header of a TableView
*/
TableColumn: (props) => Object.freeze({ title: "", min_width: 0, horizontal_stretch: 0, sort_order: "unsorted", width: 0, ...props }),
};
/**
* Built-in enums and structs from the Slint language.
* Enum values are accessed via `language.ColorScheme.Dark`; struct values via the
* factory call `language.PointerEvent({ button: … })`. Enum and struct types are
* available in type position as `language.ColorScheme` / `language.PointerEvent`.
*/
exports.language = _data;