Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
ax_enums.h
Go to the documentation of this file.
1// Copyright 2018 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_ENUMS_H_
6#define UI_ACCESSIBILITY_AX_ENUMS_H_
7
8// For new entries to the following four enums, also add to
9// extensions/common/api/automation.idl. This is enforced
10// by a PRESUBMIT check.
11//
12// Explanation of in-lined comments next to some enum values/attributes:
13//
14// Web: this attribute is only used in web content.
15//
16// Native: this attribute is only used in native UI.
17//
18// Implicit: for events, it would be cleaner if we just updated the AX node and
19// each platform fired the appropriate events to indicate which
20// platform-specific attributes changed.
21//
22// if Native / [Platform1, ...] is specified, the attribute is only used
23// on those platforms.
24//
25// If unspecified, the attribute is used across web and native on multiple
26// platforms.
27namespace ax {
28
29namespace mojom {
30
31enum class Event {
32 kNone,
34 kAlert,
35 kAriaAttributeChanged, // Implicit
36 kAutocorrectionOccured, // Unknown: http://crbug.com/392498
37 kBlur, // Remove: http://crbug.com/392502
38 kCheckedStateChanged, // Implicit
44 kEndOfTest, // Sentinel value indicating the end of a test
45 kExpandedChanged, // Web
46 kFocus,
48 kFocusContext, // Contextual focus event that must delay the next focus event
49 kHide, // Remove: http://crbug.com/392502
51 kHover,
52 kImageFrameUpdated, // Web
53 kInvalidStatusChanged, // Implicit
54 kLayoutComplete, // Web
55 kLiveRegionCreated, // Implicit
56 kLiveRegionChanged, // Web
57 kLoadComplete, // Web
58 kLoadStart, // Web / AuraLinux
59 kLocationChanged, // Web
60 kMediaStartedPlaying, // Native / Automation
61 kMediaStoppedPlaying, // Native / Automation
62 kMenuEnd, // Native / web: menu interaction has ended.
65 kMenuPopupEnd, // Native / web: a menu/submenu is hidden/closed.
66 kMenuPopupStart, // Native / web: a menu/submenu is shown/opened.
67 kMenuStart, // Native / web: menu interaction has begun.
77 kScrolledToAnchor, // Web
79 kSelection, // Native
80 kSelectionAdd, // Native
81 kSelectionRemove, // Native
82 kShow, // Native / Automation
83 kStateChanged, // Native / Automation
85 kWindowActivated, // Native
86 kWindowDeactivated, // Native
91 kTreeChanged, // Accessibility tree changed. Don't
92 // explicitly fire an accessibility event,
93 // only implicitly due to the change.
97};
98
99// Accessibility object roles.
100// The majority of these roles come from the ARIA specification. Reference
101// the latest draft for proper usage.
102//
103// Roles not included by the ARIA specification should be avoided, especially
104// internal roles used by the accessibility infrastructure.
105//
106// Explanation of in-lined comments next to some enum values.
107//
108// Web: this attribute is only used in web content.
109//
110// Native: this attribute is only used in native UI.
111enum class Role {
112 kNone,
113 kAbbr,
114 kAlert,
116 kAnchor,
118 kArticle,
119 kAudio,
120 kBanner,
122 kButton,
123 kCanvas,
124 kCaption,
125 kCaret,
126 kCell,
127 kCheckBox,
128 kClient,
129 kCode,
131 kColumn,
136 kComment,
140 kDate,
141 kDateTime,
146 kDesktop, // internal
147 kDetails,
148 kDialog,
151 // --------------------------------------------------------------
152 // DPub Roles:
153 // https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table
165 kDocCover,
179 kDocIndex,
185 kDocPart,
189 kDocQna,
191 kDocTip,
192 kDocToc,
193 // End DPub roles.
194 // --------------------------------------------------------------
195 kDocument,
197 kEmphasis,
198 kFeed,
200 kFigure,
201 kFooter,
203 kForm,
205 // --------------------------------------------------------------
206 // ARIA Graphics module roles:
207 // https://rawgit.com/w3c/graphics-aam/master/#mapping_role_table
211 // End ARIA Graphics module roles.
212 // --------------------------------------------------------------
213 kGrid,
214 kGroup,
215 kHeader,
217 kHeading,
218 kIframe,
220 kIgnored,
221 kImage,
222 kImageMap,
226 kKeyboard,
231 kLegend,
233 kLink,
234 kList,
235 kListBox,
237 // kListGrid behaves similar to an ARIA grid but is primarily used by
238 // TableView and its subclasses, so that they could be exposed correctly on
239 // certain platforms.
240 kListGrid, // Native
241 kListItem,
243 kLog,
244 kMain,
245 kMark,
246 kMarquee,
247 kMath,
248 kMenu,
249 kMenuBar,
250 kMenuItem,
255 kMeter,
257 kNote,
258 kPane,
260 kPdfActionableHighlight, // PDF specific highlight role.
263 kPortal,
264 kPre,
269 kRegion,
271 kRow,
272 kRowGroup,
274 kRuby,
278 kSearch,
280 kSection,
281 kSlider,
284 kSplitter,
286 kStatus,
287 kStrong,
289 kSvgRoot,
290 kSwitch,
291 kTab,
292 kTabList,
293 kTabPanel,
294 kTable,
296 kTerm,
299 kTime,
300 kTimer,
301 kTitleBar,
303 kToolbar,
304 kTooltip,
305 kTree,
306 kTreeGrid,
307 kTreeItem,
308 kUnknown,
309 kVideo,
310 kWebArea,
311 kWebView,
312 kWindow,
315};
316
317enum class State {
318 kNone,
321 kDefault,
322 kEditable,
323 kExpanded,
325 // Grows horizontally, e.g. most toolbars and separators.
327 kHovered,
328 // Skip over this node in the accessibility tree, but keep its subtree.
329 kIgnored,
331 kLinked,
335 kRequired,
337 // Grows vertically, e.g. menu or combo box.
338 kVertical,
339 kVisited,
342};
343
344// An action to be taken on an accessibility node.
345// In contrast to |AXDefaultActionVerb|, these describe what happens to the
346// object, e.g. "FOCUS".
347enum class Action {
348 kNone,
349
350 // Request image annotations for all the eligible images on a page.
352
353 kBlur,
354
355 // Notifies a node that it no longer has accessibility focus.
356 // Currently used only on Android and only internally, it's not
357 // exposed to the open web. See kSetAccessibilityFocus, below.
359
360 // Collapse the collapsible node.
361 kCollapse,
362
364
365 // Decrement a slider or range control by one step value.
367
368 // Do the default action for an object, typically this means "click".
370
371 // Expand the expandable node.
372 kExpand,
373
374 kFocus,
375
376 // Return the content of this image object in the image_data attribute.
378
379 // Gets the bounding rect for a range of text.
381
383
384 // Given a point, find the object it corresponds to and fire a
385 // |AXActionData.hit_test_event_to_fire| event on it in response.
386 kHitTest,
387
388 // Increment a slider or range control by one step value.
390
391 // For internal use only; signals to tree sources to invalidate an entire
392 // tree.
394
395 // Load inline text boxes for this subtree, providing information
396 // about word boundaries, line layout, and individual character
397 // bounding boxes.
399
400 // Delete any selected text in the control's text value and
401 // insert |AXActionData::value| in its place, like when typing or pasting.
403
404 // Scrolls by approximately one screen in a specific direction. Should be
405 // called on a node that has scrollable boolean set to true.
411 kScrollUp,
412
413 // Scroll any scrollable containers to make the target object visible
414 // on the screen. Optionally pass a subfocus rect in
415 // AXActionData.target_rect, in node-local coordinates.
417
418 // Scroll the given object to a specified point on the screen in
419 // global screen coordinates. Pass a point in AXActionData.target_point.
421
422 // Notifies a node that it has accessibility focus.
423 // Currently used only on Android and only internally, it's not
424 // exposed to the open web. See kClearAccessibilityFocus, above.
426
429
430 // Don't focus this node, but set it as the sequential focus navigation
431 // starting point, so that pressing Tab moves to the next element
432 // following this one, for example.
434
435 // Replace the value of the control with AXActionData::value and
436 // reset the selection, if applicable.
437 kSetValue,
439
440 // Send an event signaling the end of a test.
443 // Used for looping through the enum, This must be the last value of this
444 // enum.
447};
448
456
457// A list of valid values for the horizontal and vertical scroll alignment
458// arguments in |AXActionData|. These values control where a node is scrolled
459// in the viewport.
471
472// A list of valid values for the scroll behavior argument to argument in
473// |AXActionData|. These values control whether a node is scrolled in the
474// viewport if it is already visible.
482
483// A list of valid values for the |AXIntAttribute| |default_action_verb|.
484// These will describe the action that will be performed on a given node when
485// executing the default action, which is a click.
486// In contrast to |AXAction|, these describe what the user can do on the
487// object, e.g. "PRESS", not what happens to the object as a result.
488// Only one verb can be used at a time to describe the default action.
490 kNone,
491 kActivate,
492 kCheck,
493 kClick,
494
495 // A click will be performed on one of the node's ancestors.
496 // This happens when the node itself is not clickable, but one of its
497 // ancestors has click handlers attached which are able to capture the click
498 // as it bubbles up.
500
501 kJump,
502 kOpen,
503 kPress,
504 kSelect,
505 kUncheck,
508};
509
510// A change to the accessibility tree.
520
521enum class StringAttribute {
522 kNone,
524 // Only used when invalid_state == invalid_state_other.
532 kDisplay,
533 // Only present when different from parent.
535 kHtmlTag,
536 // Stores an automatic image annotation if one is available. Only valid on
537 // ax::mojom::Role::kImage. See kImageAnnotationStatus, too.
543 // Only present when different from parent.
544 kLanguage,
545 kName,
548 // Only if not already exposed in kName (NameFrom::kPlaceholder)
550 kRole,
552 // Only if not already exposed in kName (NameFrom::kTitle)
553 kTooltip,
554 kUrl,
555 kValue,
558};
559
560enum class IntAttribute {
561 kNone,
563 // Scrollable container attributes.
564 kScrollX,
567 kScrollY,
570
571 // Attributes for retrieving the endpoints of a selection.
574
575 // aria_col* and aria_row* attributes
582
583 // Table attributes.
587
588 // Table row attributes.
591
592 // Table column attributes.
595
596 // Table cell attributes.
602
603 // Tree control attributes.
605
606 // What information was used to compute the object's name
607 // (of type AXNameFrom).
608 kNameFrom,
609
610 // What information was used to compute the object's description
611 // (of type AXDescriptionFrom).
613
614 // Relationships between this element and other elements.
622
623 // Input restriction, if any, such as readonly or disabled.
624 // Of type AXRestriction, see below.
625 // No value or enabled control or other object that is not disabled.
627
628 // Position or Number of items in current set of listitems or treeitems
629 kSetSize,
630 kPosInSet,
631
632 // In the case of Role::kColorWell, specifies the selected color.
634
635 // Indicates the element that represents the current item within a container
636 // or set of related elements.
638
639 // Text attributes.
640
641 // Foreground and background color in RGBA.
643 kColor,
644
645 kHasPopup,
646
647 // Image annotation status, of type ImageAnnotationStatus.
649
650 // Indicates if a form control has invalid input or
651 // if an element has an aria-invalid attribute.
653
654 // Of type AXCheckedState
656
657 // The list style type. Only available on list items.
659
660 // Specifies the alignment of the text, e.g. left, center, right, justify
662
663 // Specifies the direction of the text, e.g., right-to-left.
665
666 // Specifies the position of the text, e.g., subscript.
668
669 // Bold, italic, underline, etc.
671
672 // The overline text decoration style.
674
675 // The strikethrough text decoration style.
677
678 // The underline text decoration style.
680
681 // Focus traversal in views and Android.
684
685 // For indicating what functions can be performed when a dragged object
686 // is released on the drop target.
687 // Note: aria-dropeffect is deprecated in WAI-ARIA 1.1.
689
690 // The DOMNodeID from Blink. Currently only populated when using
691 // the accessibility tree for PDF exporting. Warning, this is totally
692 // unrelated to the accessibility node ID, or the ID attribute for an
693 // HTML element - it's an ID used to uniquely identify nodes in Blink.
697};
698
699enum class FloatAttribute {
700 kNone,
701 // Range attributes.
706
707 // Text attributes.
708 // Font size is in pixels.
709 kFontSize,
710
711 // Font weight can take on any arbitrary numeric value. Increments of 100 in
712 // range [0, 900] represent keywords such as light, normal, bold, etc. 0 is
713 // the default.
715
716 // The text indent of the text, in mm.
720};
721
722// These attributes can take three states:
723// true, false, or undefined/unset.
724//
725// Some attributes are only ever true or unset. In these cases, undefined is
726// equivalent to false. In other attributes, all three states have meaning.
727//
728// Finally, note that different tree sources can use all three states for a
729// given attribute, while another tree source only uses two.
730enum class BoolAttribute {
731 kNone,
732
733 // Generic busy state, does not have to be on a live region.
734 kBusy,
735
736 // The object is at the root of an editable field, such as a content
737 // editable.
739
740 // Live region attributes.
744
745 // If a dialog box is marked as explicitly modal
746 kModal,
747
748 // If this is set, all of the other fields in this struct should
749 // be ignored and only the locations should change.
751
752 // Set on a canvas element if it has fallback content.
754
755 // Indicates this node is user-scrollable, e.g. overflow:scroll|auto, as
756 // opposed to only programmatically scrollable, like overflow:hidden, or
757 // not scrollable at all, e.g. overflow:visible.
759
760 // A hint to clients that the node is clickable.
762
763 // Indicates that this node clips its children, i.e. may have
764 // overflow: hidden or clip children by default.
766
767 // Indicates that this node is not selectable because the style has
768 // user-select: none. Note that there may be other reasons why a node is
769 // not selectable - for example, bullets in a list. However, this attribute
770 // is only set on user-select: none.
772
773 // Indicates whether this node is selected or unselected.
774 kSelected,
775
776 // Indicates whether this node is selected due to selection follows focus.
778
779 // Indicates whether this node supports text location.
781
782 // Indicates whether this node can be grabbed for drag-and-drop operation.
783 // Note: aria-grabbed is deprecated in WAI-ARIA 1.1.
784 kGrabbed,
785
786 // Indicates whether this node causes a hard line-break
787 // (e.g. block level elements, or <br>)
789
790 // Indicates whether this node causes a page break
792
793 // True if the node has any ARIA attributes set.
797};
798
800 kNone,
801 // Ids of nodes that are children of this node logically, but are
802 // not children of this node in the tree structure. As an example,
803 // a table cell is a child of a row, and an 'indirect' child of a
804 // column.
806
807 // Relationships between this element and other elements.
814
815 // For static text. These int lists must be the same size; they represent
816 // the start and end character offset of each marker. Examples of markers
817 // include spelling and grammar errors, and find-in-page matches.
821
822 // For inline text. This is the pixel position of the end of this
823 // character within the bounding rectangle of this object, in the
824 // direction given by StringAttribute::kTextDirection. For example,
825 // for left-to-right text, the first offset is the right coordinate of
826 // the first character within the object's bounds, the second offset
827 // is the right coordinate of the second character, and so on.
829
830 // Used for caching. Do not read directly. Use
831 // |AXNode::GetOrComputeLineStartOffsets|
832 // For all text fields and content editable roots: A list of the start
833 // offsets of each line inside this object.
835
836 // For inline text. These int lists must be the same size; they represent
837 // the start and end character offset of each word within this text.
839 kWordEnds,
840
841 // Used for an UI element to define custom actions for it. For example, a
842 // list UI will allow a user to reorder items in the list by dragging the
843 // items. Developer can expose those actions as custom actions. Currently
844 // custom actions are used only in Android window.
848};
849
851 kNone,
852 // Descriptions for custom actions. This must be aligned with
853 // custom_action_ids.
857};
858
859enum class ListStyle {
860 kNone,
861 kCircle,
862 kDisc,
863 kImage,
864 kNumeric,
865 kSquare,
866 kOther, // Language specific ordering (alpha, roman, cjk-ideographic, etc...)
869};
870
871enum class MarkerType {
872 kNone = 0,
873 kSpelling = 1,
874 kGrammar = 2,
875 kTextMatch = 4,
876 // DocumentMarker::MarkerType::Composition = 8 is ignored for accessibility
877 // purposes
879 kSuggestion = 32,
882};
883
884// Describes a move direction in the accessibility tree that is independent of
885// the left-to-right or right-to-left direction of the text. For example, a
886// forward movement will always move to the next node in depth-first pre-order
887// traversal.
888enum class MoveDirection {
889 kForward,
890 kBackward,
891 kNone = kForward,
894};
895
896// Describes the edit or selection command that resulted in a selection or a
897// text changed event.
898enum class Command {
900 kCut,
901 kDelete,
902 kDictate,
903 kExtendSelection, // The existing selection has been extended or shrunk.
904 kFormat, // The text attributes, such as font size, have changed.
905 kInsert,
906 kMarker, // A document marker has been added or removed.
907 kMoveSelection, // The selection has been moved by a specific granularity.
908 kPaste,
909 kReplace,
910 kSetSelection, // A completely new selection has been set.
911 kType,
912 kNone = kType,
915};
916
917// Defines a set of text boundaries in the accessibility tree.
918//
919// Most boundaries come in three flavors: A "WordStartOrEnd" boundary for
920// example differs from a "WordStart" or a "WordEnd" boundary in that the first
921// would consider both the start and the end of the word to be boundaries, while
922// the other two would consider only the start or the end respectively.
923//
924// An "Object" boundary is found at the start or end of a node's entire text,
925// e.g. at the start or end of a text field.
926//
927// TODO(nektar): Split TextBoundary into TextUnit and TextBoundary.
952
953// Types of text alignment according to the IAccessible2 Object Attributes spec.
954enum class TextAlign {
955 kNone,
956 kLeft,
957 kRight,
958 kCenter,
959 kJustify,
962};
963
965 kNone,
966 kLtr,
967 kRtl,
968 kTtb,
969 kBtt,
971 kMaxValue = kBtt,
972};
973
974enum class TextPosition {
975 kNone,
980};
981
982// A Java counterpart will be generated for this enum.
983// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.accessibility
984enum class TextStyle {
985 kBold,
986 kItalic,
989 kOverline,
990 kNone,
993};
994
996 kNone,
997 kDotted,
998 kDashed,
999 kSolid,
1000 kDouble,
1001 kWavy,
1002 kMinValue = kNone,
1003 kMaxValue = kWavy,
1004};
1005
1007 kNone,
1008 kFalse,
1009 kTrue,
1010 kPage,
1011 kStep,
1012 kLocation,
1014 kDate,
1015 kTime,
1016 kMinValue = kNone,
1017 kMaxValue = kTime,
1018};
1019
1020enum class HasPopup {
1021 kFalse = 0,
1022 kTrue,
1023 kMenu,
1024 kListbox,
1025 kTree,
1026 kGrid,
1027 kDialog,
1028 kNone = kFalse,
1029 kMinValue = kNone,
1031};
1032
1033enum class InvalidState {
1034 kNone,
1035 kFalse,
1036 kTrue,
1037 kOther,
1038 kMinValue = kNone,
1039 kMaxValue = kOther,
1040};
1041
1042// Input restriction associated with an object.
1043// No value for a control means it is enabled.
1044// Use read_only for a textbox that allows focus/selection but not input.
1045// Use disabled for a control or group of controls that disallows input.
1046enum class Restriction {
1047 kNone,
1048 kReadOnly,
1049 kDisabled,
1050 kMinValue = kNone,
1052};
1053
1054enum class CheckedState {
1055 kNone,
1056 kFalse,
1057 kTrue,
1058 kMixed,
1059 kMinValue = kNone,
1060 kMaxValue = kMixed,
1061};
1062
1063enum class SortDirection {
1064 kNone,
1065 kUnsorted,
1066 kAscending,
1068 kOther,
1069 kMinValue = kNone,
1070 kMaxValue = kOther,
1071};
1072
1073enum class NameFrom {
1074 kNone,
1076 kAttribute, // E.g. aria-label.
1078 kCaption, // E.g. in the case of a table, from a caption element.
1079 kContents,
1080 kPlaceholder, // E.g. from an HTML placeholder attribute on a text field.
1081 kRelatedElement, // E.g. from a figcaption Element in a figure.
1082 kTitle, // E.g. <input type="text" title="title">.
1083 kValue, // E.g. <input type="button" value="Button's name">.
1084 kMinValue = kNone,
1085 kMaxValue = kValue,
1086};
1087
1089 kNone,
1091 kAttribute,
1092 kContents,
1094 kTitle,
1095 kMinValue = kNone,
1096 kMaxValue = kTitle,
1097};
1098
1099enum class EventFrom {
1100 kNone,
1101 kUser,
1102 kPage,
1103 kAction,
1104 kMinValue = kNone,
1106};
1107
1108// Touch gestures on Chrome OS.
1109enum class Gesture {
1110 kNone,
1111 kClick,
1113 kSwipeUp1,
1117 kSwipeUp2,
1121 kSwipeUp3,
1125 kSwipeUp4,
1128 kTap2,
1129 kTap3,
1130 kTap4,
1132 kMinValue = kNone,
1134};
1135
1136enum class TextAffinity {
1137 kNone,
1139 kUpstream,
1140 kMinValue = kNone,
1142};
1143
1144// Compares two nodes in an accessibility tree in pre-order traversal.
1145enum class TreeOrder {
1146 kNone,
1147 // Not in the same tree, or other error.
1148 kUndefined,
1149
1150 // First node is before the second one.
1151 kBefore,
1152
1153 // Nodes are the same.
1154 kEqual,
1155
1156 // First node is after the second one.
1157 kAfter,
1158 kMinValue = kNone,
1159 kMaxValue = kAfter,
1160};
1161
1162// For internal use by ui::AXTreeID / ui::AXTreeID.
1163enum class AXTreeIDType {
1164 kUnknown, // The Tree ID is unknown.
1165 kToken, // Every other tree ID must have a valid unguessable token.
1167 kMaxValue = kToken,
1168};
1169
1171 // Not an image, or image annotation feature not enabled.
1172 kNone,
1173
1174 // Not eligible due to the scheme of the page. Image annotations are only
1175 // generated for images on http, https, file and data URLs.
1177
1178 // Not loaded yet, already labeled by the author, or not eligible
1179 // due to size, type, etc.
1181
1182 // Eligible to be automatically annotated if the user requests it.
1183 // This is communicated to the user via a tutor message.
1185
1186 // Eligible to be automatically annotated but this is not communicated to the
1187 // user.
1189
1190 // An annotation has been requested but has not been received yet.
1192
1193 // An annotation has been provided and kImageAnnotation contains the
1194 // annotation text.
1196
1197 // The annotation request was processed successfully, but it was not
1198 // possible to come up with an annotation for this image.
1200
1201 // The image is classified as adult content and no annotation will
1202 // be generated.
1204
1205 // The annotation process failed, e.g. unable to contact the server,
1206 // request timed out, etc.
1208 kMinValue = kNone,
1210};
1211
1212enum class Dropeffect {
1213 kNone,
1214 kCopy,
1215 kExecute,
1216 kLink,
1217 kMove,
1218 kPopup,
1219 kMinValue = kNone,
1220 kMaxValue = kPopup,
1221};
1222
1223} // namespace mojom
1224
1225} // namespace ax
1226
1227#endif // UI_ACCESSIBILITY_AX_ENUMS_H_
StringListAttribute
Definition ax_enums.h:850
@ kSetSequentialFocusNavigationStartingPoint
ImageAnnotationStatus
Definition ax_enums.h:1170
DefaultActionVerb
Definition ax_enums.h:489
TextDecorationStyle
Definition ax_enums.h:995