#[repr(C)]pub enum AccessibilityRole {
Show 65 variants
TitleBar = 0,
MenuBar = 1,
ScrollBar = 2,
Grip = 3,
Sound = 4,
Cursor = 5,
Caret = 6,
Alert = 7,
Window = 8,
Client = 9,
MenuPopup = 10,
MenuItem = 11,
Tooltip = 12,
Application = 13,
Document = 14,
Pane = 15,
Chart = 16,
Dialog = 17,
Border = 18,
Grouping = 19,
Separator = 20,
Toolbar = 21,
StatusBar = 22,
Table = 23,
ColumnHeader = 24,
RowHeader = 25,
Column = 26,
Row = 27,
Cell = 28,
Link = 29,
HelpBalloon = 30,
Character = 31,
List = 32,
ListItem = 33,
Outline = 34,
OutlineItem = 35,
PageTab = 36,
PropertyPage = 37,
Indicator = 38,
Graphic = 39,
StaticText = 40,
Text = 41,
PushButton = 42,
CheckButton = 43,
RadioButton = 44,
ComboBox = 45,
DropList = 46,
ProgressBar = 47,
Dial = 48,
HotkeyField = 49,
Slider = 50,
SpinButton = 51,
Diagram = 52,
Animation = 53,
Equation = 54,
ButtonDropdown = 55,
ButtonMenu = 56,
ButtonDropdownGrid = 57,
Whitespace = 58,
PageTabList = 59,
Clock = 60,
SplitButton = 61,
IpAddress = 62,
Nothing = 63,
Unknown = 64,
}Expand description
Defines the element’s purpose for accessibility APIs, informing assistive technologies like screen readers about the function of a UI element. Each variant corresponds to a standard control type or UI structure.
For more details, see the MSDN Role Constants page.
Variants§
TitleBar = 0
Represents the title or caption bar of a window.
- Purpose: To identify the title bar containing the window title and system commands.
- When to use: This role is typically inserted by the operating system for standard windows.
- Example: The bar at the top of an application window displaying its name and the minimize, maximize, and close buttons.
MenuBar = 1
Represents a menu bar at the top of a window.
- Purpose: To contain a set of top-level menus for an application.
- When to use: For the main menu bar of an application, such as one containing “File,” “Edit,” and “View.”
- Example: The “File”, “Edit”, “View” menu bar at the top of a text editor.
ScrollBar = 2
Represents a vertical or horizontal scroll bar.
- Purpose: To enable scrolling through content that is larger than the visible area.
- When to use: For any scrollable region of content.
- Example: The bar on the side of a web page that allows the user to scroll up and down.
Grip = 3
Represents a handle or grip used for moving or resizing.
- Purpose: To provide a user interface element for manipulating another element’s size or position.
- When to use: For handles that allow resizing of windows, panes, or other objects.
- Example: The small textured area in the bottom-right corner of a window that can be dragged to resize it.
Sound = 4
Represents a system sound indicating an event.
- Purpose: To associate a sound with a UI event, providing an auditory cue.
- When to use: When a sound is the primary representation of an event.
- Example: A system notification sound that plays when a new message arrives.
Cursor = 5
Represents the system’s mouse pointer or other pointing device.
- Purpose: To indicate the screen position of the user’s pointing device.
- When to use: This role is managed by the operating system.
- Example: The arrow that moves on the screen as you move the mouse.
Caret = 6
Represents the text insertion point indicator.
- Purpose: To show the current text entry or editing position.
- When to use: This role is typically managed by the operating system for text input fields.
- Example: The blinking vertical line in a text box that shows where the next character will be typed.
Alert = 7
Represents an alert or notification.
- Purpose: To convey an important, non-modal message to the user.
- When to use: For non-intrusive notifications that do not require immediate user interaction.
- Example: A small, temporary “toast” notification that appears to confirm an action, like “Email sent.”
Window = 8
Represents a window frame.
- Purpose: To serve as the container for other objects like a title bar and client area.
- When to use: This is a fundamental role, typically managed by the windowing system.
- Example: The main window of any application, which contains all other UI elements.
Client = 9
Represents a window’s client area, where the main content is displayed.
- Purpose: To define the primary content area of a window.
- When to use: For the main content region of a window. It’s often the default role for a custom control container.
- Example: The area of a web browser where the web page content is rendered.
MenuPopup = 10
Represents a pop-up menu.
- Purpose: To display a list of
MenuItemobjects that appears when a user performs an action. - When to use: For context menus (right-click menus) or drop-down menus.
- Example: The menu that appears when you right-click on a file in a file explorer.
MenuItem = 11
Represents an individual item within a menu.
- Purpose: To represent a single command, option, or separator within a menu.
- When to use: For individual options inside a
MenuBarorMenuPopup. - Example: The “Save” option within the “File” menu.
Tooltip = 12
Represents a small pop-up window that provides information.
- Purpose: To offer brief, contextual help or information about a UI element.
- When to use: For informational pop-ups that appear on mouse hover.
- Example: The small box of text that appears when you hover over a button in a toolbar.
Application = 13
Represents the main window of an application.
- Purpose: To identify the top-level window of an application.
- When to use: For the primary window that represents the application itself.
- Example: The main window of a calculator or notepad application.
Document = 14
Represents a document window within an application.
- Purpose: To represent a contained document, typically in a Multiple Document Interface (MDI) application.
- When to use: For individual document windows inside a larger application shell.
- Example: In a photo editor that allows multiple images to be open in separate
windows, each image window would be a
Document.
Pane = 15
Represents a pane or a distinct section of a window.
- Purpose: To divide a window into visually and functionally distinct areas.
- When to use: For sub-regions of a window, like a navigation pane, preview pane, or sidebar.
- Example: The preview pane in an email client that shows the content of the selected email.
Chart = 16
Represents a graphical chart or graph.
- Purpose: To display data visually in a chart format.
- When to use: For any type of chart, such as a bar chart, line chart, or pie chart.
- Example: A bar chart displaying monthly sales figures.
Dialog = 17
Represents a dialog box or message box.
- Purpose: To create a secondary window that requires user interaction before returning to the main application.
- When to use: For modal or non-modal windows that prompt the user for information or a response.
- Example: The “Open File” or “Print” dialog in most applications.
Border = 18
Represents a window’s border.
- Purpose: To identify the border of a window, which is often used for resizing.
- When to use: This role is typically managed by the windowing system.
- Example: The decorative and functional frame around a window.
Grouping = 19
Represents a group of related controls.
- Purpose: To logically group other objects that share a common purpose.
- When to use: For grouping controls like a set of radio buttons or a fieldset with a legend.
- Example: A “Settings” group box in a dialog that contains several related checkboxes.
Separator = 20
Represents a visual separator.
- Purpose: To visually divide a space or a group of controls.
- When to use: For visual separators in menus, toolbars, or between panes.
- Example: The horizontal line in a menu that separates groups of related menu items.
Toolbar = 21
Represents a toolbar containing a group of controls.
- Purpose: To group controls, typically buttons, for quick access to frequently used functions.
- When to use: For a bar of buttons or other controls, usually at the top of a window or pane.
- Example: The toolbar at the top of a word processor with buttons for “Bold,” “Italic,” and “Underline.”
StatusBar = 22
Represents a status bar for displaying information.
- Purpose: To display status information about the current state of the application.
- When to use: For a bar, typically at the bottom of a window, that displays messages.
- Example: The bar at the bottom of a web browser that shows the loading status of a page.
Table = 23
Represents a data table.
- Purpose: To present data in a two-dimensional grid of rows and columns.
- When to use: For grid-like data presentation.
- Example: A spreadsheet or a table of data in a database application.
ColumnHeader = 24
Represents a column header in a table.
- Purpose: To provide a label for a column of data.
- When to use: For the headers of columns in a
Table. - Example: The header row in a spreadsheet with labels like “Name,” “Date,” and “Amount.”
RowHeader = 25
Represents a row header in a table.
- Purpose: To provide a label for a row of data.
- When to use: For the headers of rows in a
Table. - Example: The numbered rows on the left side of a spreadsheet.
Column = 26
Represents a full column of cells in a table.
- Purpose: To represent an entire column as a single accessible object.
- When to use: When it is useful to interact with a column as a whole.
- Example: The “Amount” column in a financial data table.
Row = 27
Represents a full row of cells in a table.
- Purpose: To represent an entire row as a single accessible object.
- When to use: When it is useful to interact with a row as a whole.
- Example: A row representing a single customer’s information in a customer list.
Cell = 28
Represents a single cell within a table.
- Purpose: To represent a single data point or control within a
Table. - When to use: For individual cells in a grid or table.
- Example: A single cell in a spreadsheet containing a specific value.
Link = 29
Represents a hyperlink to a resource.
- Purpose: To provide a navigational link to another document or location.
- When to use: For text or images that, when clicked, navigate to another resource.
- Example: A clickable link on a web page.
HelpBalloon = 30
Represents a help balloon or pop-up.
- Purpose: To provide more detailed help information than a standard tooltip.
- When to use: For a pop-up that offers extended help text, often initiated by a help button.
- Example: A pop-up balloon with a paragraph of help text that appears when a user clicks a help icon.
Character = 31
Represents an animated, character-like graphic object.
- Purpose: To provide an animated agent for user assistance or entertainment.
- When to use: For animated characters or avatars that provide help or guidance.
- Example: An animated paperclip that offers tips in a word processor (e.g., Microsoft’s Clippy).
List = 32
Represents a list of items.
- Purpose: To contain a set of
ListItemobjects. - When to use: For list boxes or similar controls that present a list of selectable items.
- Example: The list of files in a file selection dialog.
ListItem = 33
Represents an individual item within a list.
- Purpose: To represent a single, selectable item within a
List. - When to use: For each individual item in a list box or combo box.
- Example: A single file name in a list of files.
Outline = 34
Represents an outline or tree structure.
- Purpose: To display a hierarchical view of data.
- When to use: For tree-view controls that show nested items.
- Example: A file explorer’s folder tree view.
OutlineItem = 35
Represents an individual item within an outline or tree.
- Purpose: To represent a single node (which can be a leaf or a branch) in an
Outline. - When to use: For each node in a tree view.
- Example: A single folder in a file explorer’s tree view.
PageTab = 36
Represents a single tab in a tabbed interface.
- Purpose: To provide a control for switching between different
PropertyPageviews. - When to use: For the individual tabs that the user can click to switch pages.
- Example: The “General” and “Security” tabs in a file properties dialog.
PropertyPage = 37
Represents the content of a page in a property sheet.
- Purpose: To serve as a container for the controls displayed when a
PageTabis selected. - When to use: For the content area associated with a specific tab.
- Example: The set of options displayed when the “Security” tab is active.
Indicator = 38
Represents a visual indicator, like a slider thumb.
- Purpose: To visually indicate the current value or position of another control.
- When to use: For a sub-element that indicates status, like the thumb of a scrollbar.
- Example: The draggable thumb of a scrollbar that indicates the current scroll position.
Graphic = 39
Represents a picture or graphical image.
- Purpose: To display a non-interactive image.
- When to use: For images and icons that are purely decorative or informational.
- Example: A company logo displayed in an application’s “About” dialog.
StaticText = 40
Represents read-only text.
- Purpose: To provide a non-editable text label for another control or for displaying information.
- When to use: For text that the user cannot edit.
- Example: The label “Username:” next to a text input field.
Text = 41
Represents editable text or a text area.
- Purpose: To allow for user text input or selection.
- When to use: For text input fields where the user can type.
- Example: A text box for entering a username or password.
PushButton = 42
Represents a standard push button.
- Purpose: To initiate an immediate action.
- When to use: For standard buttons that perform an action when clicked.
- Example: An “OK” or “Cancel” button in a dialog.
CheckButton = 43
Represents a check box control.
- Purpose: To allow the user to make a binary choice (checked or unchecked).
- When to use: For options that can be toggled on or off independently.
- Example: A “Remember me” checkbox on a login form.
RadioButton = 44
Represents a radio button.
- Purpose: To allow the user to select one option from a mutually exclusive group.
- When to use: For a choice where only one option from a
Groupingcan be selected. - Example: “Male” and “Female” radio buttons for selecting gender.
ComboBox = 45
Represents a combination of a text field and a drop-down list.
- Purpose: To allow the user to either type a value or select one from a list.
- When to use: For controls that offer a list of suggestions but also allow custom input.
- Example: A font selector that allows you to type a font name or choose one from a list.
DropList = 46
Represents a drop-down list box.
- Purpose: To allow the user to select an item from a non-editable list that drops down.
- When to use: For selecting a single item from a predefined list of options.
- Example: A country selection drop-down menu.
ProgressBar = 47
Represents a progress bar.
- Purpose: To indicate the progress of a lengthy operation.
- When to use: To provide feedback for tasks like file downloads or installations.
- Example: The bar that fills up to show the progress of a file copy operation.
Dial = 48
Represents a dial or knob.
- Purpose: To allow selecting a value from a continuous or discrete range, often circularly.
- When to use: For controls that resemble real-world dials, like a volume knob.
- Example: A volume control knob in a media player application.
HotkeyField = 49
Represents a control for entering a keyboard shortcut.
- Purpose: To capture a key combination from the user.
- When to use: In settings where users can define their own keyboard shortcuts.
- Example: A text field in a settings dialog where a user can press a key combination to assign it to a command.
Slider = 50
Represents a slider for selecting a value within a range.
- Purpose: To allow the user to adjust a setting along a continuous or discrete range.
- When to use: For adjusting values like volume, brightness, or zoom level.
- Example: A slider to control the volume of a video.
SpinButton = 51
Represents a spin button (up/down arrows) for incrementing or decrementing a value.
- Purpose: To provide fine-tuned adjustment of a value, typically numeric.
- When to use: For controls that allow stepping through a range of values.
- Example: The up and down arrows next to a number input for setting the font size.
Diagram = 52
Represents a diagram or flowchart.
- Purpose: To represent data or relationships in a schematic form.
- When to use: For visual representations of structures that are not charts, like a database schema diagram.
- Example: A flowchart illustrating a business process.
Animation = 53
Represents an animation control.
- Purpose: To display a sequence of images or indicate an ongoing process.
- When to use: For animations that show that an operation is in progress.
- Example: The animation that plays while files are being copied.
Equation = 54
Represents a mathematical equation.
- Purpose: To display a mathematical formula in the correct format.
- When to use: For displaying mathematical equations.
- Example: A rendered mathematical equation in a scientific document editor.
ButtonDropdown = 55
Represents a button that drops down a list of items.
- Purpose: To combine a default action button with a list of alternative actions.
- When to use: For buttons that have a primary action and a secondary list of options.
- Example: A “Send” button with a dropdown arrow that reveals “Send and Archive.”
ButtonMenu = 56
Represents a button that drops down a full menu.
- Purpose: To provide a button that opens a menu of choices rather than performing a single action.
- When to use: When a button’s primary purpose is to reveal a menu.
- Example: A “Tools” button that opens a menu with various tool options.
ButtonDropdownGrid = 57
Represents a button that drops down a grid for selection.
- Purpose: To allow selection from a two-dimensional grid of options.
- When to use: For buttons that open a grid-based selection UI.
- Example: A color picker button that opens a grid of color swatches.
Whitespace = 58
Represents blank space between other objects.
- Purpose: To represent significant empty areas in a UI that are part of the layout.
- When to use: Sparingly, to signify that a large area is intentionally blank.
- Example: A large empty panel in a complex layout might use this role.
PageTabList = 59
Represents the container for a set of tabs.
- Purpose: To group a set of
PageTabelements. - When to use: To act as the parent container for a row or column of tabs.
- Example: The entire row of tabs at the top of a properties dialog.
Clock = 60
Represents a clock control.
- Purpose: To display the current time.
- When to use: For any UI element that displays time.
- Example: The clock in the system tray of the operating system.
SplitButton = 61
Represents a button with two parts: a default action and a dropdown.
- Purpose: To combine a frequently used action with a set of related, less-used actions.
- When to use: When a button has a default action and other related actions available in a dropdown.
- Example: A “Save” split button where the primary part saves, and the dropdown offers “Save As.”
IpAddress = 62
Represents a control for entering an IP address.
- Purpose: To provide a specialized input field for IP addresses, often with formatting and validation.
- When to use: For dedicated IP address input fields.
- Example: A network configuration dialog with a field for entering a static IP address.
Nothing = 63
Represents an element with no specific role.
- Purpose: To indicate an element that has no semantic meaning for accessibility.
- When to use: Should be used sparingly for purely decorative elements that should be ignored by assistive technologies.
- Example: A decorative graphical flourish that has no function or information to convey.
Unknown = 64
Unknown or unspecified role.
- Purpose: Default fallback when no specific role is assigned.
- When to use: As a default value or when role information is unavailable.
Trait Implementations§
Source§impl Clone for AccessibilityRole
impl Clone for AccessibilityRole
Source§fn clone(&self) -> AccessibilityRole
fn clone(&self) -> AccessibilityRole
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccessibilityRole
impl Debug for AccessibilityRole
Source§impl Hash for AccessibilityRole
impl Hash for AccessibilityRole
Source§impl Ord for AccessibilityRole
impl Ord for AccessibilityRole
Source§fn cmp(&self, other: &AccessibilityRole) -> Ordering
fn cmp(&self, other: &AccessibilityRole) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AccessibilityRole
impl PartialEq for AccessibilityRole
Source§impl PartialOrd for AccessibilityRole
impl PartialOrd for AccessibilityRole
impl Copy for AccessibilityRole
impl Eq for AccessibilityRole
impl StructuralPartialEq for AccessibilityRole
Auto Trait Implementations§
impl Freeze for AccessibilityRole
impl RefUnwindSafe for AccessibilityRole
impl Send for AccessibilityRole
impl Sync for AccessibilityRole
impl Unpin for AccessibilityRole
impl UnwindSafe for AccessibilityRole
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more