Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ax_role_properties.h
Go to the documentation of this file.
1// Copyright 2017 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_
6#define UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_
7
8#include "ax_base_export.h"
9#include "ax_enums.h"
10
11namespace ui {
12
13// This file contains various helper functions that determine whether a
14// specific accessibility role meets certain criteria.
15//
16// Please keep these functions in alphabetic order.
17
18// Returns true for object roles that have the attribute "Children
19// Presentational: True" as defined in the ARIA Specification.
20// https://www.w3.org/TR/wai-aria-1.1/#childrenArePresentational.
22
23// Returns true if the given role is an alert or alert-dialog type.
25
26// Returns true if the provided role belongs to a native or an ARIA button.
28
29// Returns true if the provided role belongs to an object on which a click
30// handler is commonly attached, or to an object that carries out an action when
31// clicked, such as activating itself, opening a dialog or closing a menu.
32//
33// A button and a checkbox fall in the first category, whilst a color well and a
34// list menu option in the second. Note that a text field, or a similar element,
35// also carries out an action when clicked. It focuses itself, so the action
36// verb is "activate". Not all roles that inherently support a click handler or
37// that can potentially be focused are included, because in that case even a div
38// could be made clickable or focusable.
39//
40// The reason for the existence of this function is that certain screen readers,
41// such as Jaws, might need to report such objects as clickable to their users,
42// so that users will know that they could activate them if they so choose.
44
45// Returns true if the provided role belongs to a cell or a table header.
47
48// Returns true if the provided role belongs to a container with selectable
49// children.
51 const ax::mojom::Role role);
52
53// Returns true if the provided role is a control.
55
56// Returns true if the provided role is a control on the Android platform.
58 bool isFocusable);
59
60// Returns true if the provided role belongs to a document.
62
63// Returns true if the provided role represents a dialog.
65
66// Returns true if the provided role is a form.
68
69// Returns true if crossing into or out of the provided role should count as
70// crossing a format boundary.
72
73// Returns true if the provided role belongs to a heading.
75
76// Returns true if the provided role belongs to a heading or a table header.
78
79// Returns true if the provided role belongs to an iframe.
81
82// Returns true if the provided role belongs to an image, graphic, canvas, etc.
84
85// Returns true if the provided role is for any kind of image or video.
87
88// Returns true if the provided role is item-like, specifically if it can hold
89// pos_in_set and set_size values.
91
92// Returns true if the role is a subclass of the ARIA Landmark abstract role.
94
95// Returns true if the provided role belongs to a link.
97
98// Returns true if the provided role belongs to a list.
100
101// Returns true if the provided role belongs to a list item.
103
104// Returns true if the provided role belongs to a menu item, including menu item
105// checkbox and menu item radio buttons.
107
108// Returns true if the provided role belongs to a menu or related control.
110
111// Returns true if the provided role is presentational in nature, i.e. a node
112// whose implicit native role semantics will not be mapped to the accessibility
113// API.
115
116// Returns true if the provided role belongs to a radio.
117AX_BASE_EXPORT bool IsRadio(const ax::mojom::Role role);
118
119// Returns true if the provided role supports a range-based value, such as a
120// slider.
122
123// Returns true if this object supports readonly.
124//
125// Note: This returns false for table cells and headers, it is up to the
126// caller to make sure that they are included IFF they are within an
127// ARIA-1.1+ role='grid' or 'treegrid', and not role='table'.
129
130// Returns true if the provided role belongs to a widget that can contain a
131// table or grid row.
133
134// Returns true if the role is a subclass of the ARIA Section abstract role.
136
137// Returns true if the role is a subclass of the ARIA Sectionhead role.
139
140// Returns true if the role is a subclass of the ARIA Select abstract role.
142
143// Returns true if the provided role is ordered-set like, specifically if it
144// can hold set_size values.
146
147// Returns true if the provided role belongs to a non-interactive list.
149
150// Returns true if the role is a subclass of the ARIA Structure abstract role.
152
153// Returns true if the provided role belongs to a table or grid column, and the
154// table is not used for layout purposes.
156
157// Returns true if the provided role belongs to a table header.
159
160// Returns true if the provided role belongs to a table, a grid or a treegrid.
162
163// Returns true if the provided role belongs to a table or grid row, and the
164// table is not used for layout purposes.
166
167// Returns true if the provided role is text-related, e.g., static text, line
168// break, or inline text box.
170
171// Returns true if the role supports expand/collapse.
173
174// Returns true if the role supports hierarchical level.
176
177// Returns true if the provided role can have an orientation.
179
180// Returns true if the provided role supports aria-selected state.
182
183// Returns true if the provided role supports toggle.
185
186// Returns true if the node should be read only by default
188 const ax::mojom::Role role);
189
190} // namespace ui
191
192#endif // UI_ACCESSIBILITY_AX_ROLE_PROPERTIES_H_
#define AX_BASE_EXPORT
bool IsImage(const ax::mojom::Role role)
bool IsTableColumn(ax::mojom::Role role)
bool IsForm(const ax::mojom::Role role)
bool IsSelect(const ax::mojom::Role role)
bool SupportsSelected(const ax::mojom::Role role)
bool IsRangeValueSupported(const ax::mojom::Role role)
bool IsContainerWithSelectableChildren(const ax::mojom::Role role)
bool IsControl(const ax::mojom::Role role)
bool IsMenuRelated(const ax::mojom::Role role)
bool IsReadOnlySupported(const ax::mojom::Role role)
bool IsSection(const ax::mojom::Role role)
bool IsLink(const ax::mojom::Role role)
bool IsStructure(const ax::mojom::Role role)
bool IsCellOrTableHeader(const ax::mojom::Role role)
bool IsRowContainer(const ax::mojom::Role role)
bool HasPresentationalChildren(const ax::mojom::Role role)
bool IsHeadingOrTableHeader(const ax::mojom::Role role)
bool IsMenuItem(ax::mojom::Role role)
bool SupportsHierarchicalLevel(const ax::mojom::Role role)
bool IsTableRow(ax::mojom::Role role)
bool IsImageOrVideo(const ax::mojom::Role role)
bool IsItemLike(const ax::mojom::Role role)
bool IsTableLike(const ax::mojom::Role role)
bool SupportsExpandCollapse(const ax::mojom::Role role)
bool IsIframe(ax::mojom::Role role)
bool IsRadio(const ax::mojom::Role role)
bool SupportsOrientation(const ax::mojom::Role role)
bool IsTableHeader(ax::mojom::Role role)
bool IsSectionhead(const ax::mojom::Role role)
bool IsListItem(const ax::mojom::Role role)
bool IsSetLike(const ax::mojom::Role role)
bool SupportsToggle(const ax::mojom::Role role)
bool IsFormatBoundary(const ax::mojom::Role role)
bool ShouldHaveReadonlyStateByDefault(const ax::mojom::Role role)
bool IsLandmark(const ax::mojom::Role role)
bool IsClickable(const ax::mojom::Role role)
bool IsList(const ax::mojom::Role role)
bool IsDialog(const ax::mojom::Role role)
bool IsStaticList(const ax::mojom::Role role)
bool IsButton(const ax::mojom::Role role)
bool IsControlOnAndroid(const ax::mojom::Role role, bool isFocusable)
bool IsHeading(const ax::mojom::Role role)
bool IsText(ax::mojom::Role role)
bool IsPresentational(const ax::mojom::Role role)
bool IsAlert(const ax::mojom::Role role)
bool IsDocument(const ax::mojom::Role role)