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// Must also be kept in sync with extensions/common/api/automation.idl.
6module ax.mojom;
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.
27
28enum Event {
29  kNone,
30  kActiveDescendantChanged,
31  kAlert,
32  kAriaAttributeChanged,   // Implicit
33  kAutocorrectionOccured,  // Unknown: http://crbug.com/392498
34  kBlur,                   // Remove: http://crbug.com/392502
35  kCheckedStateChanged,    // Implicit
36  kChildrenChanged,
37  kClicked,
38  kControlsChanged,
39  kDocumentSelectionChanged,
40  kDocumentTitleChanged,
41  kEndOfTest,        // Sentinel value indicating the end of a test
42  kExpandedChanged,  // Web
43  kFocus,
44  kFocusAfterMenuClose,
45  kFocusContext,  // Contextual focus event that must delay the next focus event
46  kHide,          // Remove: http://crbug.com/392502
47  kHitTestResult,
48  kHover,
49  kImageFrameUpdated,     // Web
50  kLayoutComplete,        // Web
51  kLiveRegionCreated,     // Implicit
52  kLiveRegionChanged,     // Web
53  kLoadComplete,          // Web
54  kLoadStart,             // Web / AuraLinux
55  kLocationChanged,       // Web
56  kMediaStartedPlaying,   // Native / Automation
57  kMediaStoppedPlaying,   // Native / Automation
58  kMenuEnd,               // Native / web: menu interaction has ended.
59  kMenuListValueChanged,  // Web
60  kMenuPopupEnd,          // Native / web: a menu/submenu is hidden/closed.
61  kMenuPopupStart,        // Native / web: a menu/submenu is shown/opened.
62  kMenuStart,             // Native / web: menu interaction has begun.
63  kMouseCanceled,
64  kMouseDragged,
65  kMouseMoved,
66  kMousePressed,
67  kMouseReleased,
68  kRowCollapsed,
69  kRowCountChanged,
70  kRowExpanded,
71  kScrollPositionChanged,    // Web
72  kScrolledToAnchor,         // Web
73  kSelectedChildrenChanged,  // Web
74  kSelection,                // Native
75  kSelectionAdd,             // Native
76  kSelectionRemove,          // Native
77  kShow,                     // Native / Automation
78  kStateChanged,             // Native / Automation
79  kTextChanged,
80  // TODO(nektar): Remove kTextSelectionChanged.
81  kTextSelectionChanged,
82  kTooltipClosed,
83  kTooltipOpened,
84  kTreeChanged,  // Don't explicitly fire this event.
85  // TODO(nektar): Remove kValueChanged.
86  kValueChanged,
87  kWindowActivated,             // Native
88  kWindowDeactivated,           // Native
89  kWindowVisibilityChanged,     // Native
90};
91
92// Accessibility object roles.
93// The majority of these roles come from the ARIA specification. Reference
94// the latest draft for proper usage.
95//
96// Roles not included by the ARIA specification should be avoided, especially
97// internal roles used by the accessibility infrastructure.
98//
99// Explanation of in-lined comments next to some enum values.
100//
101// Web: this attribute is only used in web content.
102//
103// Native: this attribute is only used in native UI.
104enum Role {
105  kNone,
106  kAbbr,
107  kAlert,
108  kAlertDialog,
109  kAnchor,
110  kApplication,
111  kArticle,
112  kAudio,
113  kBanner,
114  kBlockquote,
115  kButton,
116  kCanvas,
117  kCaption,
118  kCaret,
119  kCell,
120  kCheckBox,
121  kClient,
122  kCode,
123  kColorWell,
124  kColumn,
125  kColumnHeader,
126  kComboBoxGrouping,
127  kComboBoxMenuButton,
128  kComplementary,
129  kComment,
130  kContentDeletion,
131  kContentInsertion,
132  kContentInfo,
133  kDate,
134  kDateTime,
135  kDefinition,
136  kDescriptionList,
137  kDescriptionListDetail,
138  kDescriptionListTerm,
139  kDesktop,  // internal
140  kDetails,
141  kDialog,
142  kDirectory,
143  kDisclosureTriangle,
144  // --------------------------------------------------------------
145  // DPub Roles:
146  // https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table
147  kDocAbstract,
148  kDocAcknowledgments,
149  kDocAfterword,
150  kDocAppendix,
151  kDocBackLink,
152  kDocBiblioEntry,
153  kDocBibliography,
154  kDocBiblioRef,
155  kDocChapter,
156  kDocColophon,
157  kDocConclusion,
158  kDocCover,
159  kDocCredit,
160  kDocCredits,
161  kDocDedication,
162  kDocEndnote,
163  kDocEndnotes,
164  kDocEpigraph,
165  kDocEpilogue,
166  kDocErrata,
167  kDocExample,
168  kDocFootnote,
169  kDocForeword,
170  kDocGlossary,
171  kDocGlossRef,
172  kDocIndex,
173  kDocIntroduction,
174  kDocNoteRef,
175  kDocNotice,
176  kDocPageBreak,
177  kDocPageFooter,
178  kDocPageHeader,
179  kDocPageList,
180  kDocPart,
181  kDocPreface,
182  kDocPrologue,
183  kDocPullquote,
184  kDocQna,
185  kDocSubtitle,
186  kDocTip,
187  kDocToc,
188  // End DPub roles.
189  // --------------------------------------------------------------
190  kDocument,
191  kEmbeddedObject,
192  kEmphasis,
193  kFeed,
194  kFigcaption,
195  kFigure,
196  kFooter,
197  kFooterAsNonLandmark,
198  kForm,
199  kGenericContainer,
200  // --------------------------------------------------------------
201  // ARIA Graphics module roles:
202  // https://rawgit.com/w3c/graphics-aam/master/#mapping_role_table
203  kGraphicsDocument,
204  kGraphicsObject,
205  kGraphicsSymbol,
206  // End ARIA Graphics module roles.
207  // --------------------------------------------------------------
208  kGrid,
209  kGroup,
210  kHeader,
211  kHeaderAsNonLandmark,
212  kHeading,
213  kIframe,
214  kIframePresentational,
215  kIgnored,
216  kImage,
217  kImageMap,
218  kImeCandidate,
219  kInlineTextBox,
220  kInputTime,
221  kKeyboard,
222  kLabelText,
223  kLayoutTable,
224  kLayoutTableCell,
225  kLayoutTableRow,
226  kLegend,
227  kLineBreak,
228  kLink,
229  kList,
230  kListBox,
231  kListBoxOption,
232  // kListGrid behaves similar to an ARIA grid but is primarily used by
233  // TableView and its subclasses, so that they could be exposed correctly on
234  // certain platforms.
235  kListGrid,  // Native
236  kListItem,
237  kListMarker,
238  kLog,
239  kMain,
240  kMark,
241  kMarquee,
242  kMath,
243  kMenu,
244  kMenuBar,
245  kMenuItem,
246  kMenuItemCheckBox,
247  kMenuItemRadio,
248  kMenuListOption,
249  kMenuListPopup,
250  kMeter,
251  kNavigation,
252  kNote,
253  kPane,
254  kParagraph,
255  kPdfActionableHighlight, // PDF specific highlight role.
256  kPluginObject,
257  kPopUpButton,
258  kPortal,
259  kPre,
260  kPresentational,
261  kProgressIndicator,
262  kRadioButton,
263  kRadioGroup,
264  kRegion,
265  kRootWebArea,
266  kRow,
267  kRowGroup,
268  kRowHeader,
269  kRuby,
270  kRubyAnnotation,
271  kScrollBar,
272  kScrollView,
273  kSearch,
274  kSearchBox,
275  kSection,
276  kSlider,
277  kSliderThumb,
278  kSpinButton,
279  kSplitter,
280  kStaticText,
281  kStatus,
282  kStrong,
283  kSuggestion,
284  kSvgRoot,
285  kSwitch,
286  kTab,
287  kTabList,
288  kTabPanel,
289  kTable,
290  kTableHeaderContainer,
291  kTerm,
292  kTextField,
293  kTextFieldWithComboBox,
294  kTime,
295  kTimer,
296  kTitleBar,
297  kToggleButton,
298  kToolbar,
299  kTooltip,
300  kTree,
301  kTreeGrid,
302  kTreeItem,
303  kUnknown,
304  kVideo,
305  kWebArea,
306  kWebView,
307  kWindow,
308};
309
310enum State {
311  kNone,
312  kAutofillAvailable,
313  kCollapsed,
314  kDefault,
315  kEditable,
316  kExpanded,
317  kFocusable,
318  // Grows horizontally, e.g. most toolbars and separators.
319  kHorizontal,
320  kHovered,
321  // Skip over this node in the accessibility tree, but keep its subtree.
322  kIgnored,
323  kInvisible,
324  kLinked,
325  kMultiline,
326  kMultiselectable,
327  kProtected,
328  kRequired,
329  kRichlyEditable,
330  // Grows vertically, e.g. menu or combo box.
331  kVertical,
332  kVisited,
333};
334
335// An action to be taken on an accessibility node.
336// In contrast to |AXDefaultActionVerb|, these describe what happens to the
337// object, e.g. "FOCUS".
338enum Action {
339  kNone,
340
341  // Request image annotations for all the eligible images on a page.
342  kAnnotatePageImages,
343
344  kBlur,
345
346  // Notifies a node that it no longer has accessibility focus.
347  // Currently used only on Android and only internally, it's not
348  // exposed to the open web. See kSetAccessibilityFocus, below.
349  kClearAccessibilityFocus,
350
351  // Collapse the collapsible node.
352  kCollapse,
353
354  kCustomAction,
355
356  // Decrement a slider or range control by one step value.
357  kDecrement,
358
359  // Do the default action for an object, typically this means "click".
360  kDoDefault,
361
362  // Expand the expandable node.
363  kExpand,
364
365  kFocus,
366
367  // Return the content of this image object in the image_data attribute.
368  kGetImageData,
369
370  // Gets the bounding rect for a range of text.
371  kGetTextLocation,
372
373  kHideTooltip,
374
375  // Given a point, find the object it corresponds to and fire a
376  // |AXActionData.hit_test_event_to_fire| event on it in response.
377  kHitTest,
378
379  // Increment a slider or range control by one step value.
380  kIncrement,
381
382  // For internal use only; signals to tree sources to invalidate an entire
383  // tree.
384  kInternalInvalidateTree,
385
386  // Load inline text boxes for this subtree, providing information
387  // about word boundaries, line layout, and individual character
388  // bounding boxes.
389  kLoadInlineTextBoxes,
390
391  // Delete any selected text in the control's text value and
392  // insert |AXActionData::value| in its place, like when typing or pasting.
393  kReplaceSelectedText,
394
395  // Scrolls by approximately one screen in a specific direction. Should be
396  // called on a node that has scrollable boolean set to true.
397  kScrollBackward,
398  kScrollDown,
399  kScrollForward,
400  kScrollLeft,
401  kScrollRight,
402  kScrollUp,
403
404  // Scroll any scrollable containers to make the target object visible
405  // on the screen.  Optionally pass a subfocus rect in
406  // AXActionData.target_rect, in node-local coordinates.
407  kScrollToMakeVisible,
408
409  // Scroll the given object to a specified point on the screen in
410  // global screen coordinates. Pass a point in AXActionData.target_point.
411  kScrollToPoint,
412
413  // Notifies a node that it has accessibility focus.
414  // Currently used only on Android and only internally, it's not
415  // exposed to the open web. See kClearAccessibilityFocus, above.
416  kSetAccessibilityFocus,
417
418  kSetScrollOffset,
419  kSetSelection,
420
421  // Don't focus this node, but set it as the sequential focus navigation
422  // starting point, so that pressing Tab moves to the next element
423  // following this one, for example.
424  kSetSequentialFocusNavigationStartingPoint,
425
426  // Replace the value of the control with AXActionData::value and
427  // reset the selection, if applicable.
428  kSetValue,
429  kShowContextMenu,
430
431  // Send an event signaling the end of a test.
432  kSignalEndOfTest,
433  kShowTooltip,
434};
435
436enum ActionFlags {
437  kNone,
438  kRequestImages,
439  kRequestInlineTextBoxes,
440};
441
442// A list of valid values for the horizontal and vertical scroll alignment
443// arguments in |AXActionData|. These values control where a node is scrolled
444// in the viewport.
445enum ScrollAlignment {
446  kNone,
447  kScrollAlignmentCenter,
448  kScrollAlignmentTop,
449  kScrollAlignmentBottom,
450  kScrollAlignmentLeft,
451  kScrollAlignmentRight,
452  kScrollAlignmentClosestEdge
453};
454
455// A list of valid values for the scroll behavior argument to argument in
456// |AXActionData|. These values control whether a node is scrolled in the
457// viewport if it is already visible.
458enum ScrollBehavior {
459  kNone,
460  kDoNotScrollIfVisible,
461  kScrollIfVisible,
462};
463
464// A list of valid values for the |AXIntAttribute| |default_action_verb|.
465// These will describe the action that will be performed on a given node when
466// executing the default action, which is a click.
467// In contrast to |AXAction|, these describe what the user can do on the
468// object, e.g. "PRESS", not what happens to the object as a result.
469// Only one verb can be used at a time to describe the default action.
470enum DefaultActionVerb {
471  kNone,
472  kActivate,
473  kCheck,
474  kClick,
475
476  // A click will be performed on one of the node's ancestors.
477  // This happens when the node itself is not clickable, but one of its
478  // ancestors has click handlers attached which are able to capture the click
479  // as it bubbles up.
480  kClickAncestor,
481
482  kJump,
483  kOpen,
484  kPress,
485  kSelect,
486  kUncheck,
487};
488
489// A change to the accessibility tree.
490enum Mutation {
491  kNone,
492  kNodeCreated,
493  kSubtreeCreated,
494  kNodeChanged,
495  kNodeRemoved,
496};
497
498enum StringAttribute {
499  kNone,
500  kAccessKey,
501  // Only used when invalid_state == invalid_state_other.
502  kAriaInvalidValue,
503  kAutoComplete,
504  kCheckedStateDescription,
505  kChildTreeId,
506  kClassName,
507  kContainerLiveRelevant,
508  kContainerLiveStatus,
509  kDescription,
510  kDisplay,
511  // Only present when different from parent.
512  kFontFamily,
513  kHtmlTag,
514  // Stores an automatic image annotation if one is available. Only valid on
515  // ax::mojom::Role::kImage. See kImageAnnotationStatus, too.
516  kImageAnnotation,
517  kImageDataUrl,
518  kInnerHtml,
519  kInputType,
520  kKeyShortcuts,
521  // Only present when different from parent.
522  kLanguage,
523  kName,
524  kLiveRelevant,
525  kLiveStatus,
526  // Only if not already exposed in kName (NameFrom::kPlaceholder)
527  kPlaceholder,
528  kRole,
529  kRoleDescription,
530  // Only if not already exposed in kName (NameFrom::kTitle)
531  kTooltip,
532  kUrl,
533  kValue,
534};
535
536enum IntAttribute {
537  kNone,
538  kDefaultActionVerb,
539  // Scrollable container attributes.
540  kScrollX,
541  kScrollXMin,
542  kScrollXMax,
543  kScrollY,
544  kScrollYMin,
545  kScrollYMax,
546
547  // Attributes for retrieving the endpoints of a selection.
548  kTextSelStart,
549  kTextSelEnd,
550
551  // aria_col* and aria_row* attributes
552  kAriaColumnCount,
553  kAriaCellColumnIndex,
554  kAriaCellColumnSpan,
555  kAriaRowCount,
556  kAriaCellRowIndex,
557  kAriaCellRowSpan,
558
559  // Table attributes.
560  kTableRowCount,
561  kTableColumnCount,
562  kTableHeaderId,
563
564  // Table row attributes.
565  kTableRowIndex,
566  kTableRowHeaderId,
567
568  // Table column attributes.
569  kTableColumnIndex,
570  kTableColumnHeaderId,
571
572  // Table cell attributes.
573  kTableCellColumnIndex,
574  kTableCellColumnSpan,
575  kTableCellRowIndex,
576  kTableCellRowSpan,
577  kSortDirection,
578
579  // Tree control attributes.
580  kHierarchicalLevel,
581
582  // What information was used to compute the object's name
583  // (of type AXNameFrom).
584  kNameFrom,
585
586  // What information was used to compute the object's description
587  // (of type AXDescriptionFrom).
588  kDescriptionFrom,
589
590  // Relationships between this element and other elements.
591  kActivedescendantId,
592  kErrormessageId,
593  kInPageLinkTargetId,
594  kMemberOfId,
595  kNextOnLineId,
596  kPopupForId,
597  kPreviousOnLineId,
598
599  // Input restriction, if any, such as readonly or disabled.
600  // Of type AXRestriction, see below.
601  // No value or enabled control or other object that is not disabled.
602  kRestriction,
603
604  // Position or Number of items in current set of listitems or treeitems
605  kSetSize,
606  kPosInSet,
607
608  // In the case of Role::kColorWell, specifies the selected color.
609  kColorValue,
610
611  // Indicates the element that represents the current item within a container
612  // or set of related elements.
613  kAriaCurrentState,
614
615  // Text attributes.
616
617  // Foreground and background color in RGBA.
618  kBackgroundColor,
619  kColor,
620
621  kHasPopup,
622
623  // Image annotation status, of type ImageAnnotationStatus.
624  kImageAnnotationStatus,
625
626  // Indicates if a form control has invalid input or
627  // if an element has an aria-invalid attribute.
628  kInvalidState,
629
630  // Of type AXCheckedState
631  kCheckedState,
632
633  // The list style type. Only available on list items.
634  kListStyle,
635
636  // Specifies the alignment of the text, e.g. left, center, right, justify
637  kTextAlign,
638
639  // Specifies the direction of the text, e.g., right-to-left.
640  kTextDirection,
641
642  // Specifies the position of the text, e.g., subscript.
643  kTextPosition,
644
645  // Bold, italic, underline, etc.
646  kTextStyle,
647
648  // The overline text decoration style.
649  kTextOverlineStyle,
650
651  // The strikethrough text decoration style.
652  kTextStrikethroughStyle,
653
654  // The underline text decoration style.
655  kTextUnderlineStyle,
656
657  // Focus traversal in views and Android.
658  kPreviousFocusId,
659  kNextFocusId,
660
661  // For indicating what functions can be performed when a dragged object
662  // is released on the drop target.
663  // Note: aria-dropeffect is deprecated in WAI-ARIA 1.1.
664  kDropeffect,
665
666  // The DOMNodeID from Blink. Currently only populated when using
667  // the accessibility tree for PDF exporting. Warning, this is totally
668  // unrelated to the accessibility node ID, or the ID attribute for an
669  // HTML element - it's an ID used to uniquely identify nodes in Blink.
670  kDOMNodeId,
671};
672
673enum FloatAttribute {
674  kNone,
675  // Range attributes.
676  kValueForRange,
677  kMinValueForRange,
678  kMaxValueForRange,
679  kStepValueForRange,
680
681  // Text attributes.
682  // Font size is in pixels.
683  kFontSize,
684
685  // Font weight can take on any arbitrary numeric value. Increments of 100 in
686  // range [0, 900] represent keywords such as light, normal, bold, etc. 0 is
687  // the default.
688  kFontWeight,
689
690  // The text indent of the text, in mm.
691  kTextIndent,
692};
693
694// These attributes can take three states:
695// true, false, or undefined/unset.
696//
697// Some attributes are only ever true or unset. In these cases, undefined is
698// equivalent to false. In other attributes, all three states have meaning.
699//
700// Finally, note that different tree sources can use all three states for a
701// given attribute, while another tree source only uses two.
702enum BoolAttribute {
703  kNone,
704
705  // Generic busy state, does not have to be on a live region.
706  kBusy,
707
708  // The object is at the root of an editable field, such as a content
709  // editable.
710  kEditableRoot,
711
712  // Live region attributes.
713  kContainerLiveAtomic,
714  kContainerLiveBusy,
715  kLiveAtomic,
716
717  // If a dialog box is marked as explicitly modal
718  kModal,
719
720  // If this is set, all of the other fields in this struct should
721  // be ignored and only the locations should change.
722  kUpdateLocationOnly,
723
724  // Set on a canvas element if it has fallback content.
725  kCanvasHasFallback,
726
727  // Indicates this node is user-scrollable, e.g. overflow:scroll|auto, as
728  // opposed to only programmatically scrollable, like overflow:hidden, or
729  // not scrollable at all, e.g. overflow:visible.
730  kScrollable,
731
732  // A hint to clients that the node is clickable.
733  kClickable,
734
735  // Indicates that this node clips its children, i.e. may have
736  // overflow: hidden or clip children by default.
737  kClipsChildren,
738
739  // Indicates that this node is not selectable because the style has
740  // user-select: none. Note that there may be other reasons why a node is
741  // not selectable - for example, bullets in a list. However, this attribute
742  // is only set on user-select: none.
743  kNotUserSelectableStyle,
744
745  // Indicates whether this node is selected or unselected.
746  kSelected,
747
748  // Indicates whether this node is selected due to selection follows focus.
749  kSelectedFromFocus,
750
751  // Indicates whether this node supports text location.
752  kSupportsTextLocation,
753
754  // Indicates whether this node can be grabbed for drag-and-drop operation.
755  // Note: aria-grabbed is deprecated in WAI-ARIA 1.1.
756  kGrabbed,
757
758  // Indicates whether this node causes a hard line-break
759  // (e.g. block level elements, or <br>)
760  kIsLineBreakingObject,
761
762  // Indicates whether this node causes a page break
763  kIsPageBreakingObject,
764
765  // True if the node has any ARIA attributes set.
766  kHasAriaAttribute,
767};
768
769enum IntListAttribute {
770  kNone,
771  // Ids of nodes that are children of this node logically, but are
772  // not children of this node in the tree structure. As an example,
773  // a table cell is a child of a row, and an 'indirect' child of a
774  // column.
775  kIndirectChildIds,
776
777  // Relationships between this element and other elements.
778  kControlsIds,
779  kDetailsIds,
780  kDescribedbyIds,
781  kFlowtoIds,
782  kLabelledbyIds,
783  kRadioGroupIds,
784
785  // For static text. These int lists must be the same size; they represent
786  // the start and end character offset of each marker. Examples of markers
787  // include spelling and grammar errors, and find-in-page matches.
788  kMarkerTypes,
789  kMarkerStarts,
790  kMarkerEnds,
791
792  // For inline text. This is the pixel position of the end of this
793  // character within the bounding rectangle of this object, in the
794  // direction given by StringAttribute::kTextDirection. For example,
795  // for left-to-right text, the first offset is the right coordinate of
796  // the first character within the object's bounds, the second offset
797  // is the right coordinate of the second character, and so on.
798  kCharacterOffsets,
799
800  // Used for caching. Do not read directly. Use
801  // |AXNode::GetOrComputeLineStartOffsets|
802  // For all text fields and content editable roots: A list of the start
803  // offsets of each line inside this object.
804  kCachedLineStarts,
805
806  // For inline text. These int lists must be the same size; they represent
807  // the start and end character offset of each word within this text.
808  kWordStarts,
809  kWordEnds,
810
811  // Used for an UI element to define custom actions for it. For example, a
812  // list UI will allow a user to reorder items in the list by dragging the
813  // items. Developer can expose those actions as custom actions. Currently
814  // custom actions are used only in Android window.
815  kCustomActionIds,
816};
817
818enum StringListAttribute {
819  kNone,
820  // Descriptions for custom actions. This must be aligned with
821  // custom_action_ids.
822  kCustomActionDescriptions,
823};
824
825enum ListStyle {
826  kNone,
827  kCircle,
828  kDisc,
829  kImage,
830  kNumeric,
831  kSquare,
832  kOther, // Language specific ordering (alpha, roman, cjk-ideographic, etc...)
833};
834
835enum MarkerType {
836  kNone = 0,
837  kSpelling = 1,
838  kGrammar = 2,
839  kTextMatch = 4,
840  // DocumentMarker::MarkerType::Composition = 8 is ignored for accessibility
841  // purposes
842  kActiveSuggestion = 16,
843  kSuggestion = 32,
844};
845
846// Describes a move direction in the accessibility tree that is independent of
847// the left-to-right or right-to-left direction of the text. For example, a
848// forward movement will always move to the next node in depth-first pre-order
849// traversal.
850enum MoveDirection {
851  kNone,
852  kBackward,
853  kForward
854};
855
856// Describes the edit or selection command that resulted in a selection, a text
857// changed or a text attributes changed event.
858//
859// An edit command, such as "kInsert" or "kDelete" is further described by its
860// "InputEvent" - see the relevant enum in this file.
861// A selection command may be further described by its "TextBoundary" and
862// "MoveDirection" - see the relevant enums in this file.
863enum Command {
864  kNone,
865  kClearSelection,
866  kDelete,
867  kDictate,
868  kExtendSelection,  // The existing selection has been extended or shrunk.
869  kFormat,  // Some text attributes, such as font weight, have changed.
870  kHistory,  // An undo or a redo operation has been performed.
871  kInsert,
872  kMarker,  // Document markers have been added or removed.
873  kMoveSelection,  // The selection has been moved by a specific granularity.
874  kSetSelection  // A completely new selection has been set.
875};
876
877// Describes an edit command in more detail.
878//
879// Please keep in sync with the following specification and file:
880// https://w3c.github.io/input-events/#h-interface-inputevent-attributes
881// //third_party/blink/renderer/core/events/input_event.h
882enum InputEventType {
883  kNone,
884  // Insertion.
885  kInsertText,
886  kInsertLineBreak,
887  kInsertParagraph,
888  kInsertOrderedList,
889  kInsertUnorderedList,
890  kInsertHorizontalRule,
891  kInsertFromPaste,
892  kInsertFromDrop,
893  kInsertFromYank,
894  kInsertTranspose,
895  kInsertReplacementText,
896  kInsertCompositionText,
897  // Deletion.
898  kDeleteWordBackward,
899  kDeleteWordForward,
900  kDeleteSoftLineBackward,
901  kDeleteSoftLineForward,
902  kDeleteHardLineBackward,
903  kDeleteHardLineForward,
904  kDeleteContentBackward,
905  kDeleteContentForward,
906  kDeleteByCut,
907  kDeleteByDrag,
908  // History.
909  kHistoryUndo,
910  kHistoryRedo,
911  // Formatting.
912  kFormatBold,
913  kFormatItalic,
914  kFormatUnderline,
915  kFormatStrikeThrough,
916  kFormatSuperscript,
917  kFormatSubscript,
918  kFormatJustifyCenter,
919  kFormatJustifyFull,
920  kFormatJustifyRight,
921  kFormatJustifyLeft,
922  kFormatIndent,
923  kFormatOutdent,
924  kFormatRemove,
925  kFormatSetBlockTextDirection
926};
927
928// Defines a set of text boundaries in the accessibility tree.
929//
930// Most boundaries come in three flavors: A "WordStartOrEnd" boundary for
931// example differs from a "WordStart" or a "WordEnd" boundary in that the first
932// would consider both the start and the end of the word to be boundaries, while
933// the other two would consider only the start or the end respectively.
934//
935// An "Object" boundary is found at the start or end of a node's entire text,
936// e.g. at the start or end of a text field.
937//
938// TODO(nektar): Split TextBoundary into TextUnit and TextBoundary.
939enum TextBoundary {
940  kNone,
941  kCharacter,
942  kFormat,
943  kLineEnd,
944  kLineStart,
945  kLineStartOrEnd,
946  kObject,
947  kPageEnd,
948  kPageStart,
949  kPageStartOrEnd,
950  kParagraphEnd,
951  kParagraphStart,
952  kParagraphStartOrEnd,
953  kSentenceEnd,
954  kSentenceStart,
955  kSentenceStartOrEnd,
956  kWebPage,
957  kWordEnd,
958  kWordStart,
959  kWordStartOrEnd
960};
961
962// Types of text alignment according to the IAccessible2 Object Attributes spec.
963enum TextAlign {
964  kNone,
965  kLeft,
966  kRight,
967  kCenter,
968  kJustify,
969};
970
971enum WritingDirection {
972  kNone,
973  kLtr,
974  kRtl,
975  kTtb,
976  kBtt,
977};
978
979enum TextPosition {
980  kNone,
981  kSubscript,
982  kSuperscript,
983};
984
985// A Java counterpart will be generated for this enum.
986// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.accessibility
987enum TextStyle {
988  kBold,
989  kItalic,
990  kUnderline,
991  kLineThrough,
992  kOverline,
993  kNone
994};
995
996enum TextDecorationStyle {
997  kNone,
998  kDotted,
999  kDashed,
1000  kSolid,
1001  kDouble,
1002  kWavy,
1003};
1004
1005enum AriaCurrentState {
1006  kNone,
1007  kFalse,
1008  kTrue,
1009  kPage,
1010  kStep,
1011  kLocation,
1012  kUnclippedLocation,
1013  kDate,
1014  kTime,
1015};
1016
1017enum HasPopup {
1018  kFalse = 0,
1019  kTrue,
1020  kMenu,
1021  kListbox,
1022  kTree,
1023  kGrid,
1024  kDialog,
1025  kNone = kFalse
1026};
1027
1028enum InvalidState {
1029  kNone,
1030  kFalse,
1031  kTrue,
1032  kOther,
1033};
1034
1035// Input restriction associated with an object.
1036// No value for a control means it is enabled.
1037// Use read_only for a textbox that allows focus/selection but not input.
1038// Use disabled for a control or group of controls that disallows input.
1039enum Restriction {
1040  kNone,
1041  kReadOnly,
1042  kDisabled,
1043};
1044
1045enum CheckedState {
1046  kNone,
1047  kFalse,
1048  kTrue,
1049  kMixed,
1050};
1051
1052enum SortDirection {
1053  kNone,
1054  kUnsorted,
1055  kAscending,
1056  kDescending,
1057  kOther,
1058};
1059
1060enum NameFrom {
1061  kNone,
1062  kUninitialized,
1063  kAttribute,  // E.g. aria-label.
1064  kAttributeExplicitlyEmpty,
1065  kCaption,  // E.g. in the case of a table, from a caption element.
1066  kContents,
1067  kPlaceholder,  // E.g. from an HTML placeholder attribute on a text field.
1068  kRelatedElement, // E.g. from a figcaption Element in a figure.
1069  kTitle,  // E.g. <input type="text" title="title">.
1070  kValue,  // E.g. <input type="button" value="Button's name">.
1071};
1072
1073enum DescriptionFrom {
1074  kNone,
1075  kUninitialized,
1076  kAttribute,
1077  kContents,
1078  kRelatedElement,
1079  kTitle,
1080};
1081
1082enum EventFrom {
1083  kNone,
1084  kUser,
1085  kPage,
1086  kAction,
1087};
1088
1089// Touch gestures on Chrome OS.
1090enum Gesture {
1091  kNone,
1092  kClick,
1093  kSwipeLeft1,
1094  kSwipeUp1,
1095  kSwipeRight1,
1096  kSwipeDown1,
1097  kSwipeLeft2,
1098  kSwipeUp2,
1099  kSwipeRight2,
1100  kSwipeDown2,
1101  kSwipeLeft3,
1102  kSwipeUp3,
1103  kSwipeRight3,
1104  kSwipeDown3,
1105  kSwipeLeft4,
1106  kSwipeUp4,
1107  kSwipeRight4,
1108  kSwipeDown4,
1109  kTap2,
1110  kTap3,
1111  kTap4,
1112  kTouchExplore,
1113};
1114
1115enum TextAffinity {
1116  kNone,
1117  kDownstream,
1118  kUpstream,
1119};
1120
1121// Compares two nodes in an accessibility tree in pre-order traversal.
1122enum TreeOrder {
1123  kNone,
1124  // Not in the same tree, or other error.
1125  kUndefined,
1126
1127  // First node is before the second one.
1128  kBefore,
1129
1130  // Nodes are the same.
1131  kEqual,
1132
1133  // First node is after the second one.
1134  kAfter,
1135};
1136
1137// For internal use by ui::AXTreeID / ax::mojom::AXTreeID.
1138enum AXTreeIDType {
1139  kUnknown,  // The Tree ID is unknown.
1140  kToken,    // Every other tree ID must have a valid unguessable token.
1141};
1142
1143enum ImageAnnotationStatus {
1144  // Not an image, or image annotation feature not enabled.
1145  kNone,
1146
1147  // Not eligible due to the scheme of the page. Image annotations are only
1148  // generated for images on http, https, file and data URLs.
1149  kWillNotAnnotateDueToScheme,
1150
1151  // Not loaded yet, already labeled by the author, or not eligible
1152  // due to size, type, etc.
1153  kIneligibleForAnnotation,
1154
1155  // Eligible to be automatically annotated if the user requests it.
1156  // This is communicated to the user via a tutor message.
1157  kEligibleForAnnotation,
1158
1159  // Eligible to be automatically annotated but this is not communicated to the
1160  // user.
1161  kSilentlyEligibleForAnnotation,
1162
1163  // An annotation has been requested but has not been received yet.
1164  kAnnotationPending,
1165
1166  // An annotation has been provided and kImageAnnotation contains the
1167  // annotation text.
1168  kAnnotationSucceeded,
1169
1170  // The annotation request was processed successfully, but it was not
1171  // possible to come up with an annotation for this image.
1172  kAnnotationEmpty,
1173
1174  // The image is classified as adult content and no annotation will
1175  // be generated.
1176  kAnnotationAdult,
1177
1178  // The annotation process failed, e.g. unable to contact the server,
1179  // request timed out, etc.
1180  kAnnotationProcessFailed,
1181};
1182
1183enum Dropeffect {
1184  kNone,
1185  kCopy,
1186  kExecute,
1187  kLink,
1188  kMove,
1189  kPopup,
1190};
1191