Accessibility/Comparisons:ATK To UA

From MozillaWiki
< Accessibility
Revision as of 15:02, 29 May 2006 by Hwaara (talk | contribs) (start of ATK to UA)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ATK to UA, interfaces

This page provides an overview how to do some common operations in UA, when a developer is used to ATK. I highgly recommend to read the introduction to UA before reading this document.

Any developer serious in implementing UA support should always read Apple's official accessibility documentation; this is by no means an end-all be-all document, but can give you an idea about how things work. Feel free to add and edit entries.

Interfaces

Actions (AtkAction)

There are only three APIs dealing with actions in UA:

accessibilityActionNames
gives an array of strings telling the available actions that this widget supports.
accessibilityActionDescription
returns a human-readable (localized) description of a specified action.
accessibilityPerformAction
performs a specified action.

Making a view/widget accessible (AtkComponent)

In UA, every widget has to implement a few methods to be made accessible. Those views that are invisible, and uninteresting to the user should implement the accessibilityIsIgnored method to return NO (false).

The position and size of a widget is not accessible-specific, so you call the necessary NSView methods to get that information.

Hit-testing (getting the accessible object at a given point on the screen) can be done using the accessibilityHitTest: method on any view.

To get the currently focused widget's accessibility object, accessibilityFocusedUIElement is used, which will return the deepest accessible descendant.

To set focus, there is the AXFocused attribute that is often settable. To see if a specified attribute is settable, use the accessibilityIsAttributeSettable: and then accessibilitySetValue:forAttribute: to set it.

To "manually" traverse and inspect the accessibility hierarchy of a view/widget, you get the value of these attributes:

AXChildrenAttribute
will return an array of all accessible children of the widget, skipping any ignored widgets on the way.
AXParentAttribute
will return the accessible parent of this widget, skipping any ignored widgets on the way.