blob: f8515bb087c40deac4f04295aba073e435138aeb [file] [log] [blame]
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Must also be kept in sync with chrome/common/extensions/api/automation.idl.
module ax.mojom;
// For new entries to the following four enums, also add to
// chrome/common/extensions/api/automation.idl. This is enforced
// by a PRESUBMIT check.
//
// Explanation of in-lined comments next to some enum values/attributes:
//
// Web: this attribute is only used in web content.
//
// Native: this attribute is only used in native UI.
//
// Implicit: for events, it would be cleaner if we just updated the AX node and
// each platform fired the appropriate events to indicate which
// platform-specific attributes changed.
//
// if Native / [Platform1, ...] is specified, the attribute is only used
// on those platforms.
//
// If unspecified, the atribute is used across web and native on multiple
// platforms.
enum Event {
kNone,
kActiveDescendantChanged, // Web
kAlert,
kAriaAttributeChanged, // Implicit
kAutocorrectionOccured, // Unknown: http://crbug.com/392498
kBlur, // Remove: http://crbug.com/392502
kCheckedStateChanged, // Implicit
kChildrenChanged,
kClicked,
kDocumentSelectionChanged,
kDocumentTitleChanged,
kExpandedChanged, // Web
kFocus,
kFocusContext, // Contextual focus event that must delay the next focus event
kHide, // Remove: http://crbug.com/392502
kHitTestResult,
kHover,
kImageFrameUpdated, // Web
kInvalidStatusChanged, // Implicit
kLayoutComplete, // Web
kLiveRegionCreated, // Implicit
kLiveRegionChanged, // Web
kLoadComplete, // Web
kLoadStart, // Web / AuraLinux
kLocationChanged, // Web
kMediaStartedPlaying, // Native / Automation
kMediaStoppedPlaying, // Native / Automation
kMenuEnd, // Native / Win
kMenuListItemSelected, // Web
kMenuListValueChanged, // Web
kMenuPopupEnd, // Native
kMenuPopupHide, // Native / AuraLinux
kMenuPopupStart, // Native
kMenuStart, // Native / Win
kMouseCanceled,
kMouseDragged,
kMouseMoved,
kMousePressed,
kMouseReleased,
kRowCollapsed, // Web / Mac
kRowCountChanged, // Web / Mac
kRowExpanded, // Web / Mac
kScrollPositionChanged, // Web
kScrolledToAnchor, // Web
kSelectedChildrenChanged, // Web
kSelection, // Native
kSelectionAdd, // Native
kSelectionRemove, // Native
kShow, // Remove: http://crbug.com/392502
kStateChanged, // Native / Automation
kTextChanged,
kWindowActivated, // Native
kWindowDeactivated, // Native
kTextSelectionChanged,
kTreeChanged, // Accessibility tree changed. Don't
// explicitly fire an accessibility event,
// only implicitly due to the change.
kValueChanged,
};
// Accessibility object roles.
// The majority of these roles come from the ARIA specification. Reference
// the latest draft for proper usage.
//
// Roles not included by the ARIA specification should be avoided, especially
// internal roles used by the accessibility infrastructure.
//
// Explanation of in-lined comments next to some enum values.
//
// Web: this attribute is only used in web content.
//
// Native: this attribute is only used in native UI.
enum Role {
kNone,
kAbbr,
kAlert,
kAlertDialog,
kAnchor,
kAnnotation,
kApplication,
kArticle,
kAudio,
kBanner,
kBlockquote,
kButton,
kCanvas,
kCaption,
kCaret,
kCell,
kCheckBox,
kClient,
kColorWell,
kColumn,
kColumnHeader,
kComboBoxGrouping,
kComboBoxMenuButton,
kComplementary,
kContentDeletion,
kContentInsertion,
kContentInfo,
kDate,
kDateTime,
kDefinition,
kDescriptionList,
kDescriptionListDetail,
kDescriptionListTerm,
kDesktop, // internal
kDetails,
kDialog,
kDirectory,
kDisclosureTriangle,
// --------------------------------------------------------------
// DPub Roles:
// https://www.w3.org/TR/dpub-aam-1.0/#mapping_role_table
kDocAbstract,
kDocAcknowledgments,
kDocAfterword,
kDocAppendix,
kDocBackLink,
kDocBiblioEntry,
kDocBibliography,
kDocBiblioRef,
kDocChapter,
kDocColophon,
kDocConclusion,
kDocCover,
kDocCredit,
kDocCredits,
kDocDedication,
kDocEndnote,
kDocEndnotes,
kDocEpigraph,
kDocEpilogue,
kDocErrata,
kDocExample,
kDocFootnote,
kDocForeword,
kDocGlossary,
kDocGlossRef,
kDocIndex,
kDocIntroduction,
kDocNoteRef,
kDocNotice,
kDocPageBreak,
kDocPageList,
kDocPart,
kDocPreface,
kDocPrologue,
kDocPullquote,
kDocQna,
kDocSubtitle,
kDocTip,
kDocToc,
// End DPub roles.
// --------------------------------------------------------------
kDocument,
kEmbeddedObject,
kFeed,
kFigcaption,
kFigure,
kFooter,
kForm,
kGenericContainer,
// --------------------------------------------------------------
// ARIA Graphics module roles:
// https://rawgit.com/w3c/graphics-aam/master/#mapping_role_table
kGraphicsDocument,
kGraphicsObject,
kGraphicsSymbol,
// End ARIA Graphics module roles.
// --------------------------------------------------------------
kGrid,
kGroup,
kHeading,
kIframe,
kIframePresentational,
kIgnored,
kImage,
kImageMap,
kInlineTextBox,
kInputTime,
kKeyboard,
kLabelText,
kLayoutTable,
kLayoutTableCell,
kLayoutTableColumn,
kLayoutTableRow,
kLegend,
kLineBreak,
kLink,
kList,
kListBox,
kListBoxOption,
// kListGrid behaves similar to an ARIA grid but is primarily used by
// TableView and its subclasses, so that they could be exposed correctly on
// certain platforms.
kListGrid, // Native
kListItem,
kListMarker,
kLog,
kMain,
kMark,
kMarquee,
kMath,
kMenu,
kMenuBar,
kMenuButton,
kMenuItem,
kMenuItemCheckBox,
kMenuItemRadio,
kMenuListOption,
kMenuListPopup,
kMeter,
kNavigation,
kNote,
kPane,
kParagraph,
kPopUpButton,
kPre,
kPresentational,
kProgressIndicator,
kRadioButton,
kRadioGroup,
kRegion,
kRootWebArea,
kRow,
kRowHeader,
kRuby,
kScrollBar,
kScrollView,
kSearch,
kSearchBox,
kSlider,
kSliderThumb,
kSpinButton,
kSplitter,
kStaticText,
kStatus,
kSvgRoot,
kSwitch,
kTab,
kTabList,
kTabPanel,
kTable,
kTableHeaderContainer,
kTerm,
kTextField,
kTextFieldWithComboBox,
kTime,
kTimer,
kTitleBar,
kToggleButton,
kToolbar,
kTooltip,
kTree,
kTreeGrid,
kTreeItem,
kUnknown,
kVideo,
kWebArea,
kWebView,
kWindow,
};
enum State {
kNone,
kAutofillAvailable,
kCollapsed,
kDefault,
kEditable,
kExpanded,
kFocusable,
// Grows horizontally, e.g. most toolbars and separators.
kHorizontal,
kHovered,
// Skip over this node in the accessibility tree, but keep its subtree.
kIgnored,
kInvisible,
kLinked,
kMultiline,
kMultiselectable,
kProtected,
kRequired,
kRichlyEditable,
// Grows vertically, e.g. menu or combo box.
kVertical,
kVisited,
};
// An action to be taken on an accessibility node.
// In contrast to |AXDefaultActionVerb|, these describe what happens to the
// object, e.g. "FOCUS".
enum Action {
kNone,
kBlur,
// Notifies a node that it no longer has accessibility focus.
// Currently used only on Android and only internally, it's not
// exposed to the open web. See kSetAccessibilityFocus, below.
kClearAccessibilityFocus,
kCustomAction,
// Decrement a slider or range control by one step value.
kDecrement,
// Do the default action for an object, typically this means "click".
kDoDefault,
kFocus,
// Return the content of this image object in the image_data attribute.
kGetImageData,
// Given a point, find the object it corresponds to and fire a
// |AXActionData.hit_test_event_to_fire| event on it in response.
kHitTest,
// Increment a slider or range control by one step value.
kIncrement,
// Load inline text boxes for this subtree, providing information
// about word boundaries, line layout, and individual character
// bounding boxes.
kLoadInlineTextBoxes,
// Delete any selected text in the control's text value and
// insert |AXActionData::value| in its place, like when typing or pasting.
kReplaceSelectedText,
// Scrolls by approximately one screen in a specific direction. Should be
// called on a node that has scrollable boolean set to true.
kScrollBackward,
kScrollDown,
kScrollForward,
kScrollLeft,
kScrollRight,
kScrollUp,
// Scroll any scrollable containers to make the target object visible
// on the screen. Optionally pass a subfocus rect in
// AXActionData.target_rect, in node-local coordinates.
kScrollToMakeVisible,
// Scroll the given object to a specified point on the screen in
// global screen coordinates. Pass a point in AXActionData.target_point.
kScrollToPoint,
// Notifies a node that it has accessibility focus.
// Currently used only on Android and only internally, it's not
// exposed to the open web. See kClearAccessibilityFocus, above.
kSetAccessibilityFocus,
kSetScrollOffset,
kSetSelection,
// Don't focus this node, but set it as the sequential focus navigation
// starting point, so that pressing Tab moves to the next element
// following this one, for example.
kSetSequentialFocusNavigationStartingPoint,
// Replace the value of the control with AXActionData::value and
// reset the selection, if applicable.
kSetValue,
kShowContextMenu,
kGetTextLocation,
};
enum ActionFlags {
kNone,
kRequestImages,
kRequestInlineTextBoxes,
};
// A list of valid values for the |AXIntAttribute| |default_action_verb|.
// These will describe the action that will be performed on a given node when
// executing the default action, which is a click.
// In contrast to |AXAction|, these describe what the user can do on the
// object, e.g. "PRESS", not what happens to the object as a result.
// Only one verb can be used at a time to describe the default action.
enum DefaultActionVerb {
kNone,
kActivate,
kCheck,
kClick,
// A click will be performed on one of the node's ancestors.
// This happens when the node itself is not clickable, but one of its
// ancestors has click handlers attached which are able to capture the click
// as it bubbles up.
kClickAncestor,
kJump,
kOpen,
kPress,
kSelect,
kUncheck,
};
// A change to the accessibility tree.
enum Mutation {
kNone,
kNodeCreated,
kSubtreeCreated,
kNodeChanged,
kNodeRemoved,
};
enum StringAttribute {
kNone,
kAccessKey,
// Only used when invalid_state == invalid_state_other.
kAriaInvalidValue,
kAutoComplete,
kChildTreeId,
kClassName, // Native / Android
kContainerLiveRelevant,
kContainerLiveStatus,
kDescription,
kDisplay,
// Only present when different from parent.
kFontFamily,
kHtmlTag,
// Stores an automatic image annotation if one is available. Only valid on
// ax::mojom::Role::kImage.
kImageAnnotation,
kImageDataUrl,
kInnerHtml,
kKeyShortcuts,
// Only present when different from parent.
kLanguage,
kName,
kLiveRelevant,
kLiveStatus,
kPlaceholder,
kRole,
kRoleDescription,
kUrl,
kValue,
};
enum IntAttribute {
kNone,
kDefaultActionVerb,
// Scrollable container attributes.
kScrollX,
kScrollXMin,
kScrollXMax,
kScrollY,
kScrollYMin,
kScrollYMax,
// Attributes for retrieving the endpoints of a selection.
kTextSelStart,
kTextSelEnd,
// aria_col* and aria_row* attributes
kAriaColumnCount,
kAriaCellColumnIndex,
kAriaRowCount,
kAriaCellRowIndex,
// Table attributes.
kTableRowCount,
kTableColumnCount,
kTableHeaderId,
// Table row attributes.
kTableRowIndex,
kTableRowHeaderId,
// Table column attributes.
kTableColumnIndex,
kTableColumnHeaderId,
// Table cell attributes.
kTableCellColumnIndex,
kTableCellColumnSpan,
kTableCellRowIndex,
kTableCellRowSpan,
kSortDirection,
// Tree control attributes.
kHierarchicalLevel,
// What information was used to compute the object's name
// (of type AXNameFrom).
kNameFrom,
// What information was used to compute the object's description
// (of type AXDescriptionFrom).
kDescriptionFrom,
// Relationships between this element and other elements.
kActivedescendantId,
kDetailsId,
kErrormessageId,
kInPageLinkTargetId,
kMemberOfId,
kNextOnLineId,
kPreviousOnLineId,
// Input restriction, if any, such as readonly or disabled.
// Of type AXRestriction, see below.
// No value or enabled control or other object that is not disabled.
kRestriction,
// Position or Number of items in current set of listitems or treeitems
kSetSize,
kPosInSet,
// In the case of Role::kColorWell, specifies the selected color.
kColorValue,
// Indicates the element that represents the current item within a container
// or set of related elements.
kAriaCurrentState,
// Text attributes.
// Foreground and background color in RGBA.
kBackgroundColor,
kColor,
kHasPopup,
// Indicates if a form control has invalid input or
// if an element has an aria-invalid attribute.
kInvalidState,
// Of type AXCheckedState
kCheckedState,
// Specifies the direction of the text, e.g., right-to-left.
kTextDirection,
// Specifies the position of the text, e.g., subscript.
kTextPosition,
// Bold, italic, underline, etc.
kTextStyle,
// Focus traversal in views and Android.
kPreviousFocusId,
kNextFocusId,
};
enum FloatAttribute {
kNone,
// Range attributes.
kValueForRange,
kMinValueForRange,
kMaxValueForRange,
kStepValueForRange,
// Text attributes.
// Font size is in pixels.
kFontSize,
};
// These attributes can take three states:
// true, false, or undefined/unset.
//
// Some attributes are only ever true or unset. In these cases, undefined is
// equivalent to false. In other attributes, all three states have meaning.
//
// Finally, note that different tree sources can use all three states for a
// given attribute, while another tree source only uses two.
enum BoolAttribute {
kNone,
// Generic busy state, does not have to be on a live region.
kBusy,
// The object is at the root of an editable field, such as a content
// editable.
kEditableRoot,
// Live region attributes.
kContainerLiveAtomic,
kContainerLiveBusy,
kLiveAtomic,
// If a dialog box is marked as explicitly modal
kModal,
// If this is set, all of the other fields in this struct should
// be ignored and only the locations should change.
kUpdateLocationOnly,
// Set on a canvas element if it has fallback content.
kCanvasHasFallback,
// Indicates this node is scrollable (Android only).
kScrollable,
// A hint to clients that the node is clickable.
kClickable,
// Indicates that this node clips its children, i.e. may have
// overflow: hidden or clip children by default.
kClipsChildren,
// Indicates whether this node is selected or unselected.
kSelected,
// Indicates whether this node supports text location.
kSupportsTextLocation,
};
enum IntListAttribute {
kNone,
// Ids of nodes that are children of this node logically, but are
// not children of this node in the tree structure. As an example,
// a table cell is a child of a row, and an 'indirect' child of a
// column.
kIndirectChildIds,
// Relationships between this element and other elements.
kControlsIds,
kDescribedbyIds,
kFlowtoIds,
kLabelledbyIds,
kRadioGroupIds,
// For static text. These int lists must be the same size; they represent
// the start and end character offset of each marker. Examples of markers
// include spelling and grammar errors, and find-in-page matches.
kMarkerTypes,
kMarkerStarts,
kMarkerEnds,
// For inline text. This is the pixel position of the end of this
// character within the bounding rectangle of this object, in the
// direction given by StringAttribute::kTextDirection. For example,
// for left-to-right text, the first offset is the right coordinate of
// the first character within the object's bounds, the second offset
// is the right coordinate of the second character, and so on.
kCharacterOffsets,
// Used for caching. Do not read directly. Use
// |AXNode::GetOrComputeLineStartOffsets|
// For all text fields and content editable roots: A list of the start
// offsets of each line inside this object.
kCachedLineStarts,
// For inline text. These int lists must be the same size; they represent
// the start and end character offset of each word within this text.
kWordStarts,
kWordEnds,
// Used for an UI element to define custom actions for it. For example, a
// list UI will allow a user to reorder items in the list by dragging the
// items. Developer can expose those actions as custom actions. Currently
// custom actions are used only in Android window.
kCustomActionIds,
};
enum StringListAttribute {
kNone,
// Descriptions for custom actions. This must be aligned with
// custom_action_ids.
kCustomActionDescriptions,
};
// TODO(dmazzoni, nektar): make this list not grow exponentially as new
// MarkerTypes are added
enum MarkerType {
kNone,
// Assignments are ignored by the parser, but are kept here for clarity.
kSpelling = 1,
kGrammar = 2,
kSpellingGrammar = 3,
kTextMatch = 4,
kSpellingTextMatch = 5,
kGrammarTextMatch = 6,
kSpellingGrammarTextMatch = 7,
// DocumentMarker::MarkerType::Composition = 8 is ignored for accessibility
// purposes
kActiveSuggestion = 16,
kSpellingActiveSuggestion = 17,
kGrammarActiveSuggestion = 18,
kSpellingGrammarActiveSuggestion = 19,
kTextMatchActiveSuggestion = 20,
kSpellingTextMatchActiveSuggestion = 21,
kGrammarTextMatchActiveSuggestion = 22,
kSpellingGrammarTextMatchActiveSuggestion = 23,
kSuggestion = 32,
kSpellingSuggestion = 33,
kGrammarSuggestion = 34,
kSpellingGrammarSuggestion = 35,
kTextMatchSuggestion = 36,
kSpellingTextMatchSuggestion = 37,
kGrammarTextMatchSuggestion = 38,
kSpellingGrammarTextMatchSuggestion = 39,
// We again skip over DocumentMarker::MarkerType::Composition = 8 here
kActiveSuggestionSuggestion = 48,
kSpellingActiveSuggestionSuggestion = 49,
kGrammarActiveSuggestionSuggestion = 50,
kSpellingGrammarActiveSuggestionSuggestion = 51,
kTextMatchActiveSuggestionSuggestion = 52,
kSpellingTextMatchActiveSuggestionSuggestion = 53,
kGrammarTextMatchActiveSuggestionSuggestion = 54,
kSpellingGrammarTextMatchActiveSuggestionSuggestion = 55,
};
enum TextDirection {
kNone,
kLtr,
kRtl,
kTtb,
kBtt,
};
enum TextPosition {
kNone,
kSubscript,
kSuperscript,
};
// A Java counterpart will be generated for this enum.
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.ui.accessibility
enum TextStyle {
kBold,
kItalic,
kUnderline,
kLineThrough,
kNone,
};
enum AriaCurrentState {
kNone,
kFalse,
kTrue,
kPage,
kStep,
kLocation,
kUnclippedLocation,
kDate,
kTime,
};
enum HasPopup {
kFalse = 0,
kTrue,
kMenu,
kListbox,
kTree,
kGrid,
kDialog,
kNone = kFalse
};
enum InvalidState {
kNone,
kFalse,
kTrue,
kSpelling,
kGrammar,
kOther,
};
// Input restriction associated with an object.
// No value for a control means it is enabled.
// Use read_only for a textbox that allows focus/selection but not input.
// Use disabled for a control or group of controls that disallows input.
enum Restriction {
kNone,
kReadOnly,
kDisabled,
};
enum CheckedState {
kNone,
kFalse,
kTrue,
kMixed,
};
enum SortDirection {
kNone,
kUnsorted,
kAscending,
kDescending,
kOther,
};
enum NameFrom {
kNone,
kUninitialized,
kAttribute,
kAttributeExplicitlyEmpty,
kCaption,
kContents,
kPlaceholder,
kRelatedElement,
kTitle,
kValue,
};
enum DescriptionFrom {
kNone,
kUninitialized,
kAttribute,
kContents,
kPlaceholder,
kRelatedElement,
};
enum EventFrom {
kNone,
kUser,
kPage,
kAction,
};
// Touch gestures on Chrome OS.
enum Gesture {
kNone,
kClick,
kSwipeLeft1,
kSwipeUp1,
kSwipeRight1,
kSwipeDown1,
kSwipeLeft2,
kSwipeUp2,
kSwipeRight2,
kSwipeDown2,
kSwipeLeft3,
kSwipeUp3,
kSwipeRight3,
kSwipeDown3,
kSwipeLeft4,
kSwipeUp4,
kSwipeRight4,
kSwipeDown4,
kTap2,
kTap3,
kTap4,
};
enum TextAffinity {
kNone,
kDownstream,
kUpstream,
};
// Compares two nodes in an accessibility tree in pre-order traversal.
enum TreeOrder {
kNone,
// Not in the same tree, or other error.
kUndefined,
// First node is before the second one.
kBefore,
// Nodes are the same.
kEqual,
// First node is after the second one.
kAfter,
};
// For internal use by ui::AXTreeID / ax::mojom::AXTreeID.
enum AXTreeIDType {
kUnknown, // The Tree ID is unknown.
kToken, // Every other tree ID must have a valid unguessable token.
};