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,
537 // Stores an automatic image annotation if one is available. Only valid on
538 // ax::mojom::Role::kImage. See kImageAnnotationStatus, too.
544 // Only present when different from parent.
545 kLanguage,
546 kName,
549 // Only if not already exposed in kName (NameFrom::kPlaceholder)
551 kRole,
553 // Only if not already exposed in kName (NameFrom::kTitle)
554 kTooltip,
555 kUrl,
556 kValue,
559};
560
561enum class IntAttribute {
562 kNone,
564 // Scrollable container attributes.
565 kScrollX,
568 kScrollY,
571
572 // Attributes for retrieving the endpoints of a selection.
575
576 // aria_col* and aria_row* attributes
583
584 // Table attributes.
588
589 // Table row attributes.
592
593 // Table column attributes.
596
597 // Table cell attributes.
603
604 // Tree control attributes.
606
607 // What information was used to compute the object's name
608 // (of type AXNameFrom).
609 kNameFrom,
610
611 // What information was used to compute the object's description
612 // (of type AXDescriptionFrom).
614
615 // Relationships between this element and other elements.
623
624 // Input restriction, if any, such as readonly or disabled.
625 // Of type AXRestriction, see below.
626 // No value or enabled control or other object that is not disabled.
628
629 // Position or Number of items in current set of listitems or treeitems
630 kSetSize,
631 kPosInSet,
632
633 // In the case of Role::kColorWell, specifies the selected color.
635
636 // Indicates the element that represents the current item within a container
637 // or set of related elements.
639
640 // Text attributes.
641
642 // Foreground and background color in RGBA.
644 kColor,
645
646 kHasPopup,
647
648 // Image annotation status, of type ImageAnnotationStatus.
650
651 // Indicates if a form control has invalid input or
652 // if an element has an aria-invalid attribute.
654
655 // Of type AXCheckedState
657
658 // The list style type. Only available on list items.
660
661 // Specifies the alignment of the text, e.g. left, center, right, justify
663
664 // Specifies the direction of the text, e.g., right-to-left.
666
667 // Specifies the position of the text, e.g., subscript.
669
670 // Bold, italic, underline, etc.
672
673 // The overline text decoration style.
675
676 // The strikethrough text decoration style.
678
679 // The underline text decoration style.
681
682 // Focus traversal in views and Android.
685
686 // For indicating what functions can be performed when a dragged object
687 // is released on the drop target.
688 // Note: aria-dropeffect is deprecated in WAI-ARIA 1.1.
690
691 // The DOMNodeID from Blink. Currently only populated when using
692 // the accessibility tree for PDF exporting. Warning, this is totally
693 // unrelated to the accessibility node ID, or the ID attribute for an
694 // HTML element - it's an ID used to uniquely identify nodes in Blink.
698};
699
700enum class FloatAttribute {
701 kNone,
702 // Range attributes.
707
708 // Text attributes.
709 // Font size is in pixels.
710 kFontSize,
711
712 // Font weight can take on any arbitrary numeric value. Increments of 100 in
713 // range [0, 900] represent keywords such as light, normal, bold, etc. 0 is
714 // the default.
716
717 // The text indent of the text, in mm.
721};
722
723// These attributes can take three states:
724// true, false, or undefined/unset.
725//
726// Some attributes are only ever true or unset. In these cases, undefined is
727// equivalent to false. In other attributes, all three states have meaning.
728//
729// Finally, note that different tree sources can use all three states for a
730// given attribute, while another tree source only uses two.
731enum class BoolAttribute {
732 kNone,
733
734 // Generic busy state, does not have to be on a live region.
735 kBusy,
736
737 // The object is at the root of an editable field, such as a content
738 // editable.
740
741 // Live region attributes.
745
746 // If a dialog box is marked as explicitly modal
747 kModal,
748
749 // If this is set, all of the other fields in this struct should
750 // be ignored and only the locations should change.
752
753 // Set on a canvas element if it has fallback content.
755
756 // Indicates this node is user-scrollable, e.g. overflow:scroll|auto, as
757 // opposed to only programmatically scrollable, like overflow:hidden, or
758 // not scrollable at all, e.g. overflow:visible.
760
761 // A hint to clients that the node is clickable.
763
764 // Indicates that this node clips its children, i.e. may have
765 // overflow: hidden or clip children by default.
767
768 // Indicates that this node is not selectable because the style has
769 // user-select: none. Note that there may be other reasons why a node is
770 // not selectable - for example, bullets in a list. However, this attribute
771 // is only set on user-select: none.
773
774 // Indicates whether this node is selected or unselected.
775 kSelected,
776
777 // Indicates whether this node is selected due to selection follows focus.
779
780 // Indicates whether this node supports text location.
782
783 // Indicates whether this node can be grabbed for drag-and-drop operation.
784 // Note: aria-grabbed is deprecated in WAI-ARIA 1.1.
785 kGrabbed,
786
787 // Indicates whether this node causes a hard line-break
788 // (e.g. block level elements, or <br>)
790
791 // Indicates whether this node causes a page break
793
794 // True if the node has any ARIA attributes set.
798};
799
801 kNone,
802 // Ids of nodes that are children of this node logically, but are
803 // not children of this node in the tree structure. As an example,
804 // a table cell is a child of a row, and an 'indirect' child of a
805 // column.
807
808 // Relationships between this element and other elements.
815
816 // For static text. These int lists must be the same size; they represent
817 // the start and end character offset of each marker. Examples of markers
818 // include spelling and grammar errors, and find-in-page matches.
822
823 // For inline text. This is the pixel position of the end of this
824 // character within the bounding rectangle of this object, in the
825 // direction given by StringAttribute::kTextDirection. For example,
826 // for left-to-right text, the first offset is the right coordinate of
827 // the first character within the object's bounds, the second offset
828 // is the right coordinate of the second character, and so on.
830
831 // Used for caching. Do not read directly. Use
832 // |AXNode::GetOrComputeLineStartOffsets|
833 // For all text fields and content editable roots: A list of the start
834 // offsets of each line inside this object.
836
837 // For inline text. These int lists must be the same size; they represent
838 // the start and end character offset of each word within this text.
840 kWordEnds,
841
842 // Used for an UI element to define custom actions for it. For example, a
843 // list UI will allow a user to reorder items in the list by dragging the
844 // items. Developer can expose those actions as custom actions. Currently
845 // custom actions are used only in Android window.
849};
850
852 kNone,
853 // Descriptions for custom actions. This must be aligned with
854 // custom_action_ids.
858};
859
860enum class ListStyle {
861 kNone,
862 kCircle,
863 kDisc,
864 kImage,
865 kNumeric,
866 kSquare,
867 kOther, // Language specific ordering (alpha, roman, cjk-ideographic, etc...)
870};
871
872enum class MarkerType {
873 kNone = 0,
874 kSpelling = 1,
875 kGrammar = 2,
876 kTextMatch = 4,
877 // DocumentMarker::MarkerType::Composition = 8 is ignored for accessibility
878 // purposes
880 kSuggestion = 32,
883};
884
885// Describes a move direction in the accessibility tree that is independent of
886// the left-to-right or right-to-left direction of the text. For example, a
887// forward movement will always move to the next node in depth-first pre-order
888// traversal.
889enum class MoveDirection {
890 kForward,
891 kBackward,
892 kNone = kForward,
895};
896
897// Describes the edit or selection command that resulted in a selection or a
898// text changed event.
899enum class Command {
901 kCut,
902 kDelete,
903 kDictate,
904 kExtendSelection, // The existing selection has been extended or shrunk.
905 kFormat, // The text attributes, such as font size, have changed.
906 kInsert,
907 kMarker, // A document marker has been added or removed.
908 kMoveSelection, // The selection has been moved by a specific granularity.
909 kPaste,
910 kReplace,
911 kSetSelection, // A completely new selection has been set.
912 kType,
913 kNone = kType,
916};
917
918// Defines a set of text boundaries in the accessibility tree.
919//
920// Most boundaries come in three flavors: A "WordStartOrEnd" boundary for
921// example differs from a "WordStart" or a "WordEnd" boundary in that the first
922// would consider both the start and the end of the word to be boundaries, while
923// the other two would consider only the start or the end respectively.
924//
925// An "Object" boundary is found at the start or end of a node's entire text,
926// e.g. at the start or end of a text field.
927//
928// TODO(nektar): Split TextBoundary into TextUnit and TextBoundary.
953
954// Types of text alignment according to the IAccessible2 Object Attributes spec.
955enum class TextAlign {
956 kNone,
957 kLeft,
958 kRight,
959 kCenter,
960 kJustify,
963};
964
966 kNone,
967 kLtr,
968 kRtl,
969 kTtb,
970 kBtt,
972 kMaxValue = kBtt,
973};
974
975enum class TextPosition {
976 kNone,
981};
982
983// A Java counterpart will be generated for this enum.
984// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.accessibility
985enum class TextStyle {
986 kBold,
987 kItalic,
990 kOverline,
991 kNone,
994};
995
997 kNone,
998 kDotted,
999 kDashed,
1000 kSolid,
1001 kDouble,
1002 kWavy,
1003 kMinValue = kNone,
1004 kMaxValue = kWavy,
1005};
1006
1008 kNone,
1009 kFalse,
1010 kTrue,
1011 kPage,
1012 kStep,
1013 kLocation,
1015 kDate,
1016 kTime,
1017 kMinValue = kNone,
1018 kMaxValue = kTime,
1019};
1020
1021enum class HasPopup {
1022 kFalse = 0,
1023 kTrue,
1024 kMenu,
1025 kListbox,
1026 kTree,
1027 kGrid,
1028 kDialog,
1029 kNone = kFalse,
1030 kMinValue = kNone,
1032};
1033
1034enum class InvalidState {
1035 kNone,
1036 kFalse,
1037 kTrue,
1038 kOther,
1039 kMinValue = kNone,
1040 kMaxValue = kOther,
1041};
1042
1043// Input restriction associated with an object.
1044// No value for a control means it is enabled.
1045// Use read_only for a textbox that allows focus/selection but not input.
1046// Use disabled for a control or group of controls that disallows input.
1047enum class Restriction {
1048 kNone,
1049 kReadOnly,
1050 kDisabled,
1051 kMinValue = kNone,
1053};
1054
1055enum class CheckedState {
1056 kNone,
1057 kFalse,
1058 kTrue,
1059 kMixed,
1060 kMinValue = kNone,
1061 kMaxValue = kMixed,
1062};
1063
1064enum class SortDirection {
1065 kNone,
1066 kUnsorted,
1067 kAscending,
1069 kOther,
1070 kMinValue = kNone,
1071 kMaxValue = kOther,
1072};
1073
1074enum class NameFrom {
1075 kNone,
1077 kAttribute, // E.g. aria-label.
1079 kCaption, // E.g. in the case of a table, from a caption element.
1080 kContents,
1081 kPlaceholder, // E.g. from an HTML placeholder attribute on a text field.
1082 kRelatedElement, // E.g. from a figcaption Element in a figure.
1083 kTitle, // E.g. <input type="text" title="title">.
1084 kValue, // E.g. <input type="button" value="Button's name">.
1085 kMinValue = kNone,
1086 kMaxValue = kValue,
1087};
1088
1090 kNone,
1092 kAttribute,
1093 kContents,
1095 kTitle,
1096 kMinValue = kNone,
1097 kMaxValue = kTitle,
1098};
1099
1100enum class EventFrom {
1101 kNone,
1102 kUser,
1103 kPage,
1104 kAction,
1105 kMinValue = kNone,
1107};
1108
1109// Touch gestures on Chrome OS.
1110enum class Gesture {
1111 kNone,
1112 kClick,
1114 kSwipeUp1,
1118 kSwipeUp2,
1122 kSwipeUp3,
1126 kSwipeUp4,
1129 kTap2,
1130 kTap3,
1131 kTap4,
1133 kMinValue = kNone,
1135};
1136
1137enum class TextAffinity {
1138 kNone,
1140 kUpstream,
1141 kMinValue = kNone,
1143};
1144
1145// Compares two nodes in an accessibility tree in pre-order traversal.
1146enum class TreeOrder {
1147 kNone,
1148 // Not in the same tree, or other error.
1149 kUndefined,
1150
1151 // First node is before the second one.
1152 kBefore,
1153
1154 // Nodes are the same.
1155 kEqual,
1156
1157 // First node is after the second one.
1158 kAfter,
1159 kMinValue = kNone,
1160 kMaxValue = kAfter,
1161};
1162
1163// For internal use by ui::AXTreeID / ui::AXTreeID.
1164enum class AXTreeIDType {
1165 kUnknown, // The Tree ID is unknown.
1166 kToken, // Every other tree ID must have a valid unguessable token.
1168 kMaxValue = kToken,
1169};
1170
1172 // Not an image, or image annotation feature not enabled.
1173 kNone,
1174
1175 // Not eligible due to the scheme of the page. Image annotations are only
1176 // generated for images on http, https, file and data URLs.
1178
1179 // Not loaded yet, already labeled by the author, or not eligible
1180 // due to size, type, etc.
1182
1183 // Eligible to be automatically annotated if the user requests it.
1184 // This is communicated to the user via a tutor message.
1186
1187 // Eligible to be automatically annotated but this is not communicated to the
1188 // user.
1190
1191 // An annotation has been requested but has not been received yet.
1193
1194 // An annotation has been provided and kImageAnnotation contains the
1195 // annotation text.
1197
1198 // The annotation request was processed successfully, but it was not
1199 // possible to come up with an annotation for this image.
1201
1202 // The image is classified as adult content and no annotation will
1203 // be generated.
1205
1206 // The annotation process failed, e.g. unable to contact the server,
1207 // request timed out, etc.
1209 kMinValue = kNone,
1211};
1212
1213enum class Dropeffect {
1214 kNone,
1215 kCopy,
1216 kExecute,
1217 kLink,
1218 kMove,
1219 kPopup,
1220 kMinValue = kNone,
1221 kMaxValue = kPopup,
1222};
1223
1224} // namespace mojom
1225
1226} // namespace ax
1227
1228#endif // UI_ACCESSIBILITY_AX_ENUMS_H_
StringListAttribute
Definition ax_enums.h:851
@ kSetSequentialFocusNavigationStartingPoint
ImageAnnotationStatus
Definition ax_enums.h:1171
DefaultActionVerb
Definition ax_enums.h:489
TextDecorationStyle
Definition ax_enums.h:996