Home | History | Annotate | Download | only in accessibility
      1 // Copyright 2014 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 // These should be kept in sync with third_party/WebKit/public/web/WebAXEnums.h
      6 // until the Chromium and Blink trees are merged.
      7 [camel_case_enum_to_string=true] namespace ui {
      8 
      9   // For new entries to the following three enums, also add to
     10   // chrome/common/extensions/api/automation.idl.
     11   //
     12   // Explanation of the comments next to these events:
     13   //
     14   // Web: this event is only used in web content. Unless a specific platform
     15   //      is specified, it fires a native event on multiple platforms.
     16   //
     17   // Native: this event is only used in native UI.
     18   //
     19   // Implicit: it would be cleaner if we just updated the AX node
     20   //     and each platform fired the appropriate events to indicate which
     21   //     platform-specific attributes changed.
     22   //
     23   // If unspecified, the event is used across web and native on multiple
     24   // platforms.
     25   enum AXEvent {
     26     activedescendantchanged,   // Web
     27     alert,
     28     aria_attribute_changed,    // Implicit
     29     autocorrection_occured,    // Unknown: http://crbug.com/392498
     30     blur,                      // Remove: http://crbug.com/392502
     31     checked_state_changed,     // Implicit
     32     children_changed,
     33     focus,
     34     hide,                      // Remove: http://crbug.com/392502
     35     hover,
     36     invalid_status_changed,    // Implicit
     37     layout_complete,           // Web
     38     live_region_changed,       // Web
     39     load_complete,             // Web
     40     location_changed,          // Web
     41     menu_end,                  // Native / Win
     42     menu_list_item_selected,   // Web
     43     menu_list_value_changed,   // Web
     44     menu_popup_end,            // Native / Win
     45     menu_popup_start,          // Native / Win
     46     menu_start,                // Native / Win
     47     row_collapsed,             // Web / Mac
     48     row_count_changed,         // Web / Mac
     49     row_expanded,              // Web / Mac
     50     scroll_position_changed,   // Web
     51     scrolled_to_anchor,        // Web
     52     selected_children_changed, // Web
     53     selection,                 // Native
     54     selection_add,             // Native
     55     selection_remove,          // Native
     56     show,                      // Remove: http://crbug.com/392502
     57     text_changed,
     58     text_selection_changed,
     59     value_changed
     60   };
     61 
     62   enum AXRole {
     63     alert_dialog,
     64     alert,
     65     annotation,
     66     application,
     67     article,
     68     banner,
     69     browser,
     70     busy_indicator,
     71     button,
     72     button_drop_down,
     73     canvas,
     74     cell,
     75     check_box,
     76     client,
     77     color_well,
     78     column_header,
     79     column,
     80     combo_box,
     81     complementary,
     82     content_info,
     83     definition,
     84     description_list_detail,
     85     description_list_term,
     86     desktop,
     87     dialog,
     88     directory,
     89     disclosure_triangle,
     90     div,
     91     document,
     92     drawer,
     93     editable_text,
     94     embedded_object,
     95     figcaption,
     96     figure,
     97     footer,
     98     form,
     99     grid,
    100     group,
    101     grow_area,
    102     heading,
    103     help_tag,
    104     horizontal_rule,
    105     iframe,
    106     ignored,
    107     image_map_link,
    108     image_map,
    109     image,
    110     incrementor,
    111     inline_text_box,
    112     label_text,
    113     legend,
    114     link,
    115     list_box_option,
    116     list_box,
    117     list_item,
    118     list_marker,
    119     list,
    120     location_bar,
    121     log,
    122     main,
    123     marquee,
    124     math_element,
    125     math,
    126     matte,
    127     menu_bar,
    128     menu_button,
    129     menu_item,
    130     menu_list_option,
    131     menu_list_popup,
    132     menu,
    133     navigation,
    134     note,
    135     outline,
    136     pane,
    137     paragraph,
    138     pop_up_button,
    139     presentational,
    140     progress_indicator,
    141     radio_button,
    142     radio_group,
    143     region,
    144     root_web_area,
    145     row_header,
    146     row,
    147     ruler_marker,
    148     ruler,
    149     svg_root,
    150     scroll_area,
    151     scroll_bar,
    152     seamless_web_area,
    153     search,
    154     sheet,
    155     slider,
    156     slider_thumb,
    157     spin_button_part,
    158     spin_button,
    159     split_group,
    160     splitter,
    161     static_text,
    162     status,
    163     system_wide,
    164     tab_group,
    165     tab_list,
    166     tab_panel,
    167     tab,
    168     table_header_container,
    169     table,
    170     text_area,
    171     text_field,
    172     timer,
    173     title_bar,
    174     toggle_button,
    175     toolbar,
    176     tree_grid,
    177     tree_item,
    178     tree,
    179     unknown,
    180     tooltip,
    181     value_indicator,
    182     web_area,
    183     window
    184   };
    185 
    186   // TODO(dmazzoni): switch content/ to use AX_STATE_DISABLED instead of
    187   // !AX_STATE_ENABLED, and AX_STATE_EDITABLE instead of !AX_STATE_READONLY.
    188   enum AXState {
    189     busy,
    190     checked,
    191     collapsed,
    192     default,
    193     disabled,  // ui/views only
    194     editable,  // ui/views only
    195     enabled,   // content only
    196     expanded,
    197     focusable,
    198     focused,
    199     haspopup,
    200     hovered,
    201     indeterminate,
    202     invisible,
    203     linked,
    204     multiselectable,
    205     offscreen,
    206     pressed,
    207     protected,
    208     read_only,
    209     required,
    210     selectable,
    211     selected,
    212     vertical,
    213     visited
    214   };
    215 
    216   [cpp_enum_prefix_override="ax_attr"] enum AXStringAttribute {
    217     // Document attributes.
    218     doc_url,
    219     doc_title,
    220     doc_mimetype,
    221     doc_doctype,
    222 
    223     // Attributes that could apply to any node.
    224     access_key,
    225     action,
    226     container_live_relevant,
    227     container_live_status,
    228     description,
    229     display,
    230     help,
    231     html_tag,
    232     name,
    233     live_relevant,
    234     live_status,
    235     role,
    236     shortcut,
    237     url,
    238     value
    239   };
    240 
    241   [cpp_enum_prefix_override="ax_attr"] enum AXIntAttribute {
    242     // Scrollable container attributes.
    243     scroll_x,
    244     scroll_x_min,
    245     scroll_x_max,
    246     scroll_y,
    247     scroll_y_min,
    248     scroll_y_max,
    249 
    250     // Editable text attributes.
    251     text_sel_start,
    252     text_sel_end,
    253 
    254     // Table attributes.
    255     table_row_count,
    256     table_column_count,
    257     table_header_id,
    258 
    259     // Table row attributes.
    260     table_row_index,
    261     table_row_header_id,
    262 
    263     // Table column attributes.
    264     table_column_index,
    265     table_column_header_id,
    266 
    267     // Table cell attributes.
    268     table_cell_column_index,
    269     table_cell_column_span,
    270     table_cell_row_index,
    271     table_cell_row_span,
    272 
    273     // Tree control attributes.
    274     hierarchical_level,
    275 
    276     // Relationships between this element and other elements.
    277     title_ui_element,
    278     activedescendant_id,
    279 
    280     // Color value for AX_ROLE_COLOR_WELL, each component is 0..255
    281     color_value_red,
    282     color_value_green,
    283     color_value_blue,
    284 
    285     // Inline text attributes.
    286     text_direction
    287   };
    288 
    289   [cpp_enum_prefix_override="ax_attr"] enum AXFloatAttribute {
    290     // Document attributes.
    291     doc_loading_progress,
    292 
    293     // Range attributes.
    294     value_for_range,
    295     min_value_for_range,
    296     max_value_for_range
    297   };
    298 
    299   [cpp_enum_prefix_override="ax_attr"] enum AXBoolAttribute {
    300     // Document attributes.
    301     doc_loaded,
    302 
    303     // True if a checkbox or radio button is in the "mixed" state.
    304     button_mixed,
    305 
    306     // Live region attributes.
    307     container_live_atomic,
    308     container_live_busy,
    309     live_atomic,
    310     live_busy,
    311 
    312     // ARIA readonly flag.
    313     aria_readonly,
    314 
    315     // Writeable attributes
    316     can_set_value,
    317 
    318     // If this is set, all of the other fields in this struct should
    319     // be ignored and only the locations should change.
    320     update_location_only,
    321 
    322     // Set on a canvas element if it has fallback content.
    323     canvas_has_fallback,
    324 
    325     // Set if this node is the host of an external AXTree, for
    326     // example a web view that's a child of a native view, or a
    327     // web iframe that's the child of another web frame.
    328     is_ax_tree_host
    329   };
    330 
    331   [cpp_enum_prefix_override="ax_attr"] enum AXIntListAttribute {
    332     // Ids of nodes that are children of this node logically, but are
    333     // not children of this node in the tree structure. As an example,
    334     // a table cell is a child of a row, and an 'indirect' child of a
    335     // column.
    336     indirect_child_ids,
    337 
    338     // Relationships between this element and other elements.
    339     controls_ids,
    340     describedby_ids,
    341     flowto_ids,
    342     labelledby_ids,
    343     owns_ids,
    344 
    345     // Character indices where line breaks occur.
    346     line_breaks,
    347 
    348     // For a table, the cell ids in row-major order, with duplicate entries
    349     // when there's a rowspan or colspan, and with -1 for missing cells.
    350     // There are always exactly rows * columns entries.
    351     cell_ids,
    352 
    353     // For a table, the unique cell ids in row-major order of their first
    354     // occurrence.
    355     unique_cell_ids,
    356 
    357     // For inline text. This is the pixel position of the end of this
    358     // character within the bounding rectangle of this object, in the
    359     // direction given by AX_ATTR_TEXT_DIRECTION. For example, for left-to-right
    360     // text, the first offset is the right coordinate of the first character
    361     // within the object's bounds, the second offset is the right coordinate
    362     // of the second character, and so on.
    363     character_offsets,
    364 
    365     // For inline text. These int lists must be the same size; they represent
    366     // the start and end character index of each word within this text.
    367     word_starts,
    368     word_ends
    369   };
    370 
    371   [cpp_enum_prefix_override="ax"] enum AXTextDirection {
    372     text_direction_lr,
    373     text_direction_rl,
    374     text_direction_tb,
    375     text_direction_bt
    376   };
    377 };
    378