UNO Accessibility API
The UNO Accessibility API (also called UAA in the following) is modeled closely after Java Accessibility API in version 1.4 and the the Gnome Accessibility API. The UAA is part of the offapi project. You can browse the CVS archive at com/sun/star/accessibility or have a look at the documentation here.
Representation of GUI and documents
The UAA represents both structure and content of the GUI. Here GUI included the views of documents that are embedded therein.
Each top-level window of the GUI is represented as a tree of accessibility objects. Each accessibility object stands for one GUI element or one object of a document view:
Some GUI elements are represented by leaves in the tree. Such elements are for example labels and buttons
- Internal nodes
Other GUI elements are represented by internal nodes and thus have a sub-tree of their own. An example for this are frames, menus and tool-bars. Menu items can be both depending of whether they have a sub-menu.
The root of every tree represents a top level window. This means that the accessibility representation of a running OpenOffice.org is actually a forest of accessibility trees.
This tree structure is realized by implementing the
XAccessibleContext interface. To go up
towards the root of a tree you can get an object's parent. To go down
towards the leaves of a tree you can retrieve all the children of an
RelationsRelations introduce a secondary structure that is independent of the tree hierarchy created by the parent/child relationship provided by the
XAccessibleContextinterface. Relation sets as returned by the
XAccessibleContext::getAccessibleRelationSet()are defined by the
Each node of the tree that implements
XAccessibleContext gives access to different
facets of the represented GUI element or document part. These are
- The name is a localized string and acts as short, one word description, this is e.g. the text displayed on a button.
- The kind of control or document part. E.g. the role of a
button is "button". With the
AccessibleRolecollection of constants there is a set of predefined roles that is suitable for the elements of the GUI whereas there are no (not yet) roles for the direct support of the document.
- A localized string description that is longer and more specific than the name.
- States of GUI elements as described by the
AccessibleStateTypeconstants collection can be for example "active", "hidden", or "checked". Again there is a predefined set of states suitable for GUI elements but maybe not sufficient to represent states of document parts.
- This active part of a node content can for instance open a
pop up window with a context sensitive menu. Another example are additional
navigational commands. Actions are represented by the
AccessibleRoleservice. In general there should be as few actions as possible. It is better to offer additional functionality through the clasical means of the GUI.
- graphical representation
- The graphical representation of an
accessible object is exposed by the
XAccessibleComponentinterface. It can be queried for instance for its bounding-box or for the child node at a given point on the screen.
- The actual content of a node of the accessibility tree can
have different forms:
- Text is represented by the interfaces
XAccessibleText(read only) and
XAccessibleEditableText. There is also the interface
XAccessibleHypertextfor texts that contain hyperlinks.
- Tables are represented by the interface
- Images are represented by the interface
- Simple numerical values, like the position of a slider or the value of a
spin box are represented by the
- Text is represented by the interfaces
The tree modeled by the UAA is not a static data
structure. Because of scrolling the document window, changing its content, or
modifying the contents of GUI controls, the structure and content of single
nodes and sub-trees is constantly changing. These changes are notified to the
AT by sending events to registered listeners (among them the AT). The kind of
event that is sent for a specific change depends on the UAA interfaces that
the node that represents the modified object does support and on the actual
implementation of these interfaces. Listeners to accessibility events
XAccessibleEventListener interface while broadcasters
AccessibleEventObject structures, their types
are described in the
AccessibleEventId constants group.
Independent implementation of the UAA
XAccessible interface allows the decoupling
of the implementation of the UAA from the implementation of the rest of
the UNO API. Its only method,
an object that implements the
This may or may not be done by a class other than the one that implements the
XAccessible interface. This has the big advantage, that the
existing API implementation needs only minimal modifications.
Differences between the Accessibility APIs of UNO and JavaHere is a list of major differences between the UNO and the Java Accessibility APIs:
AccessibleEditableTexthave been rearranged into the UAA interfaces
XAccessibleEditableTextto better reflect the read only and read/write access to text.
The Java class
AccessibleBundleis not supported, because it is not necessary in the UNO environment.
The Java class
AccessibleResourceBundleis not supported, because it is deprecated in the Java API.
The Java classes
AccessibleStateare realized by UNO constants collections
AccessibleStateTypedue to different API designs.
The methods of the Java class
AccessibleHyperlinkregarding actions have been removed. Instead the UNO service
AccessibleHyperlinksupports in addition to the interface
Documentation of the UNO Accessibility API
More details of the UAA can be found in the API reference.