Mac Developer Library

Developer

AXNotificationConstants.h Reference

Options
Deployment Target:

On This Page

AXNotificationConstants.h Reference

Assistive applications can register to be notified about certain events in a target application. For example, creation of a window or the destruction of a UIElement. To receive notifications you must first create an observer and specify a callback function; second, add the observer's run loop source to the run loop on which you want the callback executed; and third, register the observer for one or more notifications.

When you create the observer, you specify the application being observed. An observer can receive notifications only from UIElements in that application. To handle multiple applications, you have to create at least one observer per application.

When you register an observer for a notification, you specify the UIElement you are interested in observing. When you want to receive a notification from any element in an application, use the application UIElement; you then receive the notification regardless of which element in the application sends the notification. This is useful if the UIElement does not exist yet, such as when a new window is created, or if you care about state changes, such as the keyboard focus moving, without having to observe every element separately. When the callback function is executed it is passed the UIElement that was affected by the notification.

Observers are represented by the AXObserverRef type, which is a CFType. Like all CFTypes they are reference counted (CFRetain/CFRelease).

Callbacks

  • Priority values used for kAXPriorityKey

    Declaration

    typedef CF_ENUM( CFIndex , AXPriority) { kAXPriorityLow = 10, kAXPriorityMedium = 50, kAXPriorityHigh = 90 } CF_ENUM_AVAILABLE_MAC ( 10_9);

Constants

See the Overview section above for header-level documentation.

  • Declaration

    #define kAXAnnouncementKey CFSTR("AXAnnouncementKey") #define kAXAnnouncementRequestedNotification CFSTR("AXAnnouncementRequested") #define kAXApplicationActivatedNotification CFSTR("AXApplicationActivated") #define kAXApplicationDeactivatedNotification CFSTR("AXApplicationDeactivated") #define kAXApplicationHiddenNotification CFSTR("AXApplicationHidden") #define kAXApplicationShownNotification CFSTR("AXApplicationShown") #define kAXCreatedNotification CFSTR("AXCreated") #define kAXDrawerCreatedNotification CFSTR("AXDrawerCreated") #define kAXFocusedUIElementChangedNotification CFSTR("AXFocusedUIElementChanged") #define kAXFocusedWindowChangedNotification CFSTR("AXFocusedWindowChanged") #define kAXHelpTagCreatedNotification CFSTR("AXHelpTagCreated") #define kAXLayoutChangedNotification CFSTR("AXLayoutChanged") #define kAXMainWindowChangedNotification CFSTR("AXMainWindowChanged") #define kAXMenuClosedNotification CFSTR("AXMenuClosed") #define kAXMenuItemSelectedNotification CFSTR("AXMenuItemSelected") #define kAXMenuOpenedNotification CFSTR("AXMenuOpened") #define kAXMovedNotification CFSTR("AXMoved") #define kAXPriorityKey CFSTR("AXPriorityKey") #define kAXResizedNotification CFSTR("AXResized") #define kAXRowCollapsedNotification CFSTR("AXRowCollapsed") #define kAXRowCountChangedNotification CFSTR("AXRowCountChanged") #define kAXRowExpandedNotification CFSTR("AXRowExpanded") #define kAXSelectedCellsChangedNotification CFSTR("AXSelectedCellsChanged") #define kAXSelectedChildrenChangedNotification CFSTR("AXSelectedChildrenChanged") #define kAXSelectedChildrenMovedNotification CFSTR("AXSelectedChildrenMoved") #define kAXSelectedColumnsChangedNotification CFSTR("AXSelectedColumnsChanged") #define kAXSelectedRowsChangedNotification CFSTR("AXSelectedRowsChanged") #define kAXSelectedTextChangedNotification CFSTR("AXSelectedTextChanged") #define kAXSheetCreatedNotification CFSTR("AXSheetCreated") #define kAXTitleChangedNotification CFSTR("AXTitleChanged") #define kAXUIElementDestroyedNotification CFSTR("AXUIElementDestroyed") #define kAXUIElementsKey CFSTR("AXUIElementsKey") #define kAXUnitsChangedNotification CFSTR("AXUnitsChanged") #define kAXValueChangedNotification CFSTR("AXValueChanged") #define kAXWindowCreatedNotification CFSTR("AXWindowCreated") #define kAXWindowDeminiaturizedNotification CFSTR("AXWindowDeminiaturized") #define kAXWindowMiniaturizedNotification CFSTR("AXWindowMiniaturized") #define kAXWindowMovedNotification CFSTR("AXWindowMoved") #define kAXWindowResizedNotification CFSTR("AXWindowResized")

    Constants

    • kAXAnnouncementKey

      Notification info key used to specify an announcement to be spoken with a notification.

    • kAXAnnouncementRequestedNotification

      Notification to request an announcement to be spoken.

    • kAXApplicationActivatedNotification

      Value is an application UIElement.

    • kAXApplicationDeactivatedNotification

      Value is an application UIElement

    • kAXApplicationHiddenNotification

      Value is an application UIElement

    • kAXApplicationShownNotification

      Value is an application UIElement

    • kAXCreatedNotification

      Notification that an element was created.

    • kAXDrawerCreatedNotification

      Notification that a drawer was created.

    • kAXFocusedUIElementChangedNotification

      Value is the new focused UIElement or the Application UIElement if there's no focus

    • kAXFocusedWindowChangedNotification

      Notification that the focused window changed.

    • kAXHelpTagCreatedNotification

      Notification that a help tag was created.

    • kAXLayoutChangedNotification

      Notification that the layout changed.

    • kAXMainWindowChangedNotification

      Value is the new main window UIElement or the Application UIElement if there's no main window.

    • kAXMenuClosedNotification

      Value is the closed menu UIElement.

    • kAXMenuItemSelectedNotification

      Value is the selected menu item UIElement.

    • kAXMenuOpenedNotification

      Value is the opened menu UIElement.

    • kAXMovedNotification

      Notification that this element has moved.

    • kAXPriorityKey

      Notification info key used to specify a priority for the notification. See AXPriority.

    • kAXResizedNotification

      Notification that this element has been resized.

    • kAXRowCollapsedNotification

      The value is the collapsed row UIElement.

    • kAXRowCountChangedNotification

      Notification that the number of rows in this table has changed.

    • kAXRowExpandedNotification

      The value is the collapsed row UIElement.

    • kAXSelectedCellsChangedNotification

      Notification that the selected cells have changed.

    • kAXSelectedChildrenChangedNotification

      Notification that a different subset of this element's children were selected.

    • kAXSelectedChildrenMovedNotification

      Notification that the selected children have moved.

    • kAXSelectedColumnsChangedNotification

      Notification that the set of selected columns changed.

    • kAXSelectedRowsChangedNotification

      Notification that the set of selected rows changed.

    • kAXSelectedTextChangedNotification

      Notification that a different set of text was selected.

    • kAXSheetCreatedNotification

      Notification that a sheet was created.

    • kAXTitleChangedNotification

      Notification that the title changed.

    • kAXUIElementDestroyedNotification

      The returned UIElement is no longer valid in the target application. You can still use the local reference with calls like CFEqual (for example, to remove it from a list), but you should not pass it to the accessibility APIs.

      Value is the destroyed UIElement

    • kAXUIElementsKey

      Notification info key used to specify an element.

    • kAXUnitsChangedNotification

      Notification that the units have changed.

    • kAXValueChangedNotification

      This notification is sent when the value of the UIElement's value attribute has changed, not when the value of any other attribute has changed.

      Value is the modified UIElement

    • kAXWindowCreatedNotification

      Value is a new window UIElement

    • kAXWindowDeminiaturizedNotification

      Value is the unminimized window UIElement

    • kAXWindowMiniaturizedNotification

      Value is the minimized window UIElement

    • kAXWindowMovedNotification

      This notification is sent at the end of the window move, not continuously as the window is being moved.

      Value is the moved window UIElement

    • kAXWindowResizedNotification

      This notification is sent at the end of the window resize, not continuously as the window is being resized.

      Value is the resized window UIElement