#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
#[non_exhaustive]
pub enum AccessRole {
#[default]
Group,
Window,
Pane,
Region,
Dialog,
AlertDialog,
Label,
Paragraph,
Heading,
Link,
Image,
Button,
CheckBox,
Switch,
RadioGroup,
RadioButton,
Slider,
SpinButton,
TextInput,
MultilineTextInput,
ComboBox,
ListBox,
ListBoxOption,
List,
ListItem,
Tree,
TreeItem,
Table,
Grid,
Row,
ColumnHeader,
RowHeader,
Cell,
TabList,
Tab,
TabPanel,
MenuBar,
Menu,
MenuItem,
MenuItemCheckBox,
MenuItemRadio,
Tooltip,
Status,
Alert,
ScrollView,
ScrollBar,
Splitter,
ProgressIndicator,
ColorWell,
Toolbar,
TitleBar,
Canvas,
}
impl AccessRole {
pub(crate) fn needs_name(self) -> bool {
matches!(
self,
Self::Button
| Self::CheckBox
| Self::Switch
| Self::RadioButton
| Self::Slider
| Self::SpinButton
| Self::TextInput
| Self::MultilineTextInput
| Self::ComboBox
| Self::Link
| Self::Image
| Self::Tab
| Self::MenuItem
| Self::MenuItemCheckBox
| Self::MenuItemRadio
| Self::ColorWell
| Self::Dialog
| Self::AlertDialog
)
}
pub(crate) fn is_text(self) -> bool {
matches!(self, Self::Label | Self::Paragraph | Self::Heading)
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum AccessToggled {
False,
True,
Mixed,
}
impl From<bool> for AccessToggled {
fn from(value: bool) -> Self {
if value {
Self::True
} else {
Self::False
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum AccessLive {
Polite,
Assertive,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
pub enum AccessOrientation {
Horizontal,
Vertical,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
#[non_exhaustive]
#[repr(u8)]
pub enum AccessActionKind {
Click,
Focus,
Expand,
Collapse,
Increment,
Decrement,
SetValue,
ReplaceSelectedText,
SetTextSelection,
ScrollIntoView,
Scroll,
ShowContextMenu,
ShowTooltip,
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum AccessAction {
Click,
Expand,
Collapse,
Increment,
Decrement,
SetValue(String),
SetNumericValue(f64),
ReplaceSelectedText(String),
SetTextSelection {
anchor: usize,
focus: usize,
},
ScrollIntoView,
ScrollBy(crate::Vec2),
SetScrollOffset(crate::Vec2),
ShowContextMenu,
ShowTooltip,
HideTooltip,
}