#[non_exhaustive]pub enum Role {
Show 56 variants
Window,
Generic,
Group,
Region,
Navigation,
Toolbar,
Text,
Paragraph,
Heading,
Image,
Link,
Button,
ToggleButton,
CheckBox,
RadioButton,
RadioGroup,
Switch,
TextBox,
SearchBox,
PasswordInput,
ComboBox,
ListBox,
ListOption,
Slider,
SpinButton,
ProgressIndicator,
ScrollView,
Splitter,
Separator,
Scrim,
List,
ListItem,
Tree,
TreeItem,
Table,
Grid,
Row,
Cell,
ColumnHeader,
RowHeader,
TabList,
Tab,
TabPanel,
Menu,
MenuBar,
MenuItem,
MenuItemCheckBox,
MenuItemRadio,
Dialog,
AlertDialog,
Tooltip,
Status,
Alert,
Document,
Canvas,
Unknown,
}Expand description
The runtime role of a node, carried by trees, YAML, selector strings and the wire.
Display prints the selector name and FromStr parses it back, also accepting
AccessKit names as aliases.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Window
A top-level window. Every tree has one per window as its root.
Generic
A container with no meaning of its own.
Group
A set of related controls.
Region
A named landmark section.
A landmark holding navigation links or controls.
Toolbar
A row of controls such as buttons.
Text
A run of static text.
Paragraph
A paragraph of text.
Heading
A heading, with a level.
Image
An image.
Link
A link.
Button
A button, which may open a popup and so be expandable.
ToggleButton
A button that stays pressed or not.
CheckBox
A checkbox.
RadioButton
One radio button of a group.
RadioGroup
A group of radio buttons.
Switch
An on and off switch, such as a toggler.
TextBox
A text input or editor; multi-line editors have the multiline state.
SearchBox
A text input for search terms.
PasswordInput
A text input whose value is hidden.
ComboBox
A text input with a list of options, such as a pick list or combo box.
ListBox
A list of options to pick from.
ListOption
One option of a list box. Named so that it does not shadow Option.
Slider
A slider over a range of values.
SpinButton
A numeric input with step buttons.
ProgressIndicator
A progress bar.
ScrollView
A scrollable area.
Splitter
A focusable separator that resizes the panes either side of it.
Separator
A separator that only divides content.
Scrim
The layer that blocks the pointer under a dialog or drawer.
List
A list.
ListItem
One item of a list.
Tree
A tree view.
TreeItem
One item of a tree view.
Table
A table.
Grid
An interactive grid.
Row
A row of a table, grid or tree grid.
Cell
A cell of a table or grid.
ColumnHeader
A column header.
RowHeader
A row header.
TabList
A row of tabs.
Tab
One tab.
TabPanel
The content shown for a tab.
Menu
A menu.
MenuBar
A menu bar.
MenuItem
A menu item, which may open a submenu.
MenuItemCheckBox
A menu item with a checked state.
MenuItemRadio
A menu item that is one of a group.
Dialog
A dialog.
AlertDialog
A dialog that interrupts with an urgent message.
Tooltip
A tooltip.
Status
A live region with advisory status.
Alert
A live region with an important message.
Document
A document.
Canvas
A canvas.
Unknown
A role this version does not know, or none could be given.
Implementations§
Source§impl Role
impl Role
Sourcepub const fn selector_name(self) -> &'static str
pub const fn selector_name(self) -> &'static str
The name used in selector strings, YAML and on the wire, such as button.
Sourcepub const fn aria_name(self) -> Option<&'static str>
pub const fn aria_name(self) -> Option<&'static str>
The ARIA role name, or None where ARIA has no matching role.
Sourcepub const fn accesskit_name(self) -> &'static str
pub const fn accesskit_name(self) -> &'static str
The AccessKit role name. A multi-line text box is MultilineTextInput in
AccessKit; this returns the single-line name for Role::TextBox.
Sourcepub const fn type_name(self) -> &'static str
pub const fn type_name(self) -> &'static str
The name of the variant and of its role type in crate::role, such as Button.
Sourcepub const fn capabilities(self) -> Capabilities
pub const fn capabilities(self) -> Capabilities
The capability traits this role’s type implements.
Sourcepub const fn is_click_target(self) -> bool
pub const fn is_click_target(self) -> bool
Whether a click on the node itself is what activates it.
Source§impl Role
impl Role
Sourcepub const fn is_interactive(self) -> bool
pub const fn is_interactive(self) -> bool
Whether the role is interactive, for audits: a click target, or any capability a person acts through (checking, pressing, expanding, editing, selecting or setting a value).
Sourcepub fn from_selector_name(name: &str) -> Option<Role>
pub fn from_selector_name(name: &str) -> Option<Role>
The role with this selector name, without AccessKit aliases.
Sourcepub fn from_accesskit_name(name: &str) -> Option<Role>
pub fn from_accesskit_name(name: &str) -> Option<Role>
The role with this AccessKit name. Where several roles share one, the first in
Role::ALL wins, so GenericContainer is Role::Generic.