Skip to main content

AccessibilityRole

Enum AccessibilityRole 

Source
#[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 MenuItem objects 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 MenuBar or MenuPopup.
  • 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.

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 ListItem objects.
  • 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 PropertyPage views.
  • 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 PageTab is 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 Grouping can 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 PageTab elements.
  • 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

Source§

fn clone(&self) -> AccessibilityRole

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AccessibilityRole

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Hash for AccessibilityRole

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for AccessibilityRole

Source§

fn cmp(&self, other: &AccessibilityRole) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for AccessibilityRole

Source§

fn eq(&self, other: &AccessibilityRole) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for AccessibilityRole

Source§

fn partial_cmp(&self, other: &AccessibilityRole) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for AccessibilityRole

Source§

impl Eq for AccessibilityRole

Source§

impl StructuralPartialEq for AccessibilityRole

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GetHash for T
where T: Hash,

Source§

fn get_hash(&self) -> u64

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.