Mac Developer Library

Developer

AXRoleConstants.h Reference

Options
Deployment Target:

On This Page

AXRoleConstants.h Reference

Every role offers a variety of attributes. There are some attributes that must be supported by every element, regardless of role. Other attributes will be supported by an element if/when appropriate data is supplied by the application. These attributes' meanings and values are generally obvious. In order to save space, the following attributes are not listed in the role documentation unless the role handles them in a special fashion:

  • AXRole
  • AXRoleDescription
  • AXDescription
  • AXHelp
  • AXParent
  • AXChildren
  • AXWindow
  • AXTopLevelUIElement
  • AXEnabled
  • AXSize
  • AXPosition

Every attribute supported by a given role may have one or more symbols after its name:

  • w means the attribute is writable.
  • o means it is an optional attribute that doesn't necessarily need to be
  • supported by all elements with that role.

Constants

See the Overview section above for header-level documentation.

  • Declaration

    Objective-C

    #define kAXApplicationRole CFSTR("AXApplication") #define kAXBrowserRole CFSTR("AXBrowser") #define kAXButtonRole CFSTR("AXButton") #define kAXCheckBoxRole CFSTR("AXCheckBox") #define kAXColumnRole CFSTR("AXColumn") #define kAXDrawerRole CFSTR("AXDrawer") #define kAXGrowAreaRole CFSTR("AXGrowArea") #define kAXImageRole CFSTR("AXImage") #define kAXMenuButtonRole CFSTR("AXMenuButton") #define kAXOutlineRole CFSTR("AXOutline") #define kAXPopUpButtonRole CFSTR("AXPopUpButton") #define kAXRadioButtonRole CFSTR("AXRadioButton") #define kAXRowRole CFSTR("AXRow") #define kAXSheetRole CFSTR("AXSheet") #define kAXSystemWideRole CFSTR("AXSystemWide") #define kAXTabGroupRole CFSTR("AXTabGroup") #define kAXTableRole CFSTR("AXTable") #define kAXUnknownRole CFSTR("AXUnknown") #define kAXWindowRole CFSTR("AXWindow")

    Constants

    • kAXApplicationRole

      kAXApplicationRole

      Available in OS X v10.2 and later.

    • kAXBrowserRole

      kAXBrowserRole

      An element that contains columns of hierarchical data. Examples include the column view in Finder windows and Open/Save dialogs. Carbon's Data Browser in column view mode represents itself as an AXBrowser. Cocoa's NSBrowser represents itself as an AXBrowser.

      Browser elements are expected to have a particular hierarchy of sub-elements within it. In particular, the child of an AXBrowser must be an AXScrollArea that manages the horizontal scrolling. The horizontal AXScrollArea must include a child for each column the interface displays. Columns can be any role that makes sense. Typically, columns are vertical AXScrollAreas with AXList children. Here's a hierarchy for a typical browser:

      • AXBrowser
      • AXScrollArea (manages the horizontal scrolling)
      • AXScrollBar (horizontal scroll bar)
      • AXScrollArea (first column)
      • AXScrollBar (column's vertical scroll bar)
      • AXList (column content is typically a list, but it could be another role)
      • <Varies> (cell)
      • ...
      • <Varies> (cell)
      • AXScrollArea (second column)
      • ...
      • AXScrollArea (third column)
      • ...
      • AXGroup (preview column)
      • ...

      Attributes:

      • AXFocused (w)

      • AXColumns - Array of the grandchild column elements, which are typically of the AXScrollArea role.

      • AXVisibleColumns - Array of the subset of elements in the AXColumns array that are currently visible.

      • AXColumnTitles (o)

      • AXHorizontalScrollBar - The horizontal AXScrollBar of the browser's child AXScrollArea.

      Available in OS X v10.2 and later.

    • kAXButtonRole

      kAXButtonRole

      Available in OS X v10.2 and later.

    • kAXCheckBoxRole

      kAXCheckBoxRole

      Available in OS X v10.2 and later.

    • kAXColumnRole

      kAXColumnRole

      Available in OS X v10.2 and later.

    • kAXDrawerRole

      kAXDrawerRole

      Available in OS X v10.2 and later.

    • kAXGrowAreaRole

      kAXGrowAreaRole

      Available in OS X v10.2 and later.

    • kAXImageRole

      kAXImageRole

      Available in OS X v10.2 and later.

    • kAXMenuButtonRole

      kAXMenuButtonRole

      Available in OS X v10.2 and later.

    • kAXOutlineRole

      kAXOutlineRole

      An element that contains row-based data. It may use disclosure triangles to manage the display of hierarchies within the data. It may arrange each row's data into columns and offer a header button above each column. The best example is the list view in a Finder window or Open/Save dialog.

      Outlines are typically children of AXScrollAreas, which manages the horizontal and/or vertical scrolling for the outline. Outlines are expected to follow certain conventions with respect to their hierarchy of sub-elements. In particular, if the outline uses columns, the data should be accessible via either rows or columns. Thus, the data in a given cell will be represented as two diffrent elements. Here's a hierarchy for a typical outline:

      • AXScrollArea (parent of the outline)
      • AXScrollBar (if necessary, horizontal)
      • AXScrollBar (if necessary, vertical)
      • AXOutline
      • AXGroup (header buttons, optional)
      • AXButton, AXMenuButton, or <Varies> (header button)
      • ...
      • AXRow (first row)
      • AXStaticText (just one possible example)
      • AXButton (just another possible example)
      • AXTextField (ditto)
      • AXCheckBox (ditto)
      • AXRow (as above)
      • ...
      • AXColumn (first column)
      • AXStaticText (assumes the first column displays text)
      • AXStaticText
      • ...
      • AXColumn (second column)
      • AXButton (assumes the second column displays buttons)
      • AXButton
      • ...
      • ...

      Supported attributes:

      AXFocused

      (w)

      AXRows

      Array of subset of AXChildren that are rows

      AXVisibleRows

      Array of subset of AXRows that are visible

      AXSelectedRows

      Array of subset of AXRows that are selected (w)

      AXColumns

      Array of subset of children that are columns

      AXVisibleColumns

      Array of subset of columns that are visible

      AXSelectedColumns

      Array of subset of columns that are selected (o)

      AXHeader

      The AXGroup element that contains the header buttons (o)

      Available in OS X v10.2 and later.

    • kAXPopUpButtonRole

      kAXPopUpButtonRole

      Available in OS X v10.2 and later.

    • kAXRadioButtonRole

      kAXRadioButtonRole

      Available in OS X v10.2 and later.

    • kAXRowRole

      kAXRowRole

      Available in OS X v10.2 and later.

    • kAXSheetRole

      kAXSheetRole

      Available in OS X v10.2 and later.

    • kAXSystemWideRole

      kAXSystemWideRole

      Available in OS X v10.2 and later.

    • kAXTabGroupRole

      kAXTabGroupRole

      Available in OS X v10.2 and later.

    • kAXTableRole

      kAXTableRole

      Available in OS X v10.2 and later.

    • kAXUnknownRole

      kAXUnknownRole

      Available in OS X v10.2 and later.

    • kAXWindowRole

      kAXWindowRole

      Available in OS X v10.2 and later.