Difference between revisions of "Documentation/DevGuide/Accessibility/Using the Accessibility API"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (Robot: Changing Category:Documentation/Developers Guide/Accessibility)
m (FINAL VERSION FOR L10N)
Line 5: Line 5:
 
|NextPage=Documentation/DevGuide/Accessibility/A Simple Screen Reader
 
|NextPage=Documentation/DevGuide/Accessibility/A Simple Screen Reader
 
}}
 
}}
{{DISPLAYTITLE:Using the Accessibility API}}
+
{{Documentation/DevGuideLanguages|Documentation/DevGuide/Accessibility/{{SUBPAGENAME}}}}
 +
{{DISPLAYTITLE:Using the Accessibility API}}
 
When you are writing your own ATs and want to use the UNO accessibility API directly, you must first connect to {{PRODUCTNAME}}. Connecting to {{PRODUCTNAME}} is explained elsewhere in this document. Once a connection is established, the toolkit with its <idl>com.sun.star.awt.XExtendedToolkit</idl> interface can be used to retrieve a list of all currently open top-level windows. From these, you can then get the accessible root nodes of the accessibility object trees associated with the windows. When you register an <idl>com.sun.star.awt.XTopWindowListener</idl> you will then be informed about new top-level windows, as well as top-level windows that have disappeared.
 
When you are writing your own ATs and want to use the UNO accessibility API directly, you must first connect to {{PRODUCTNAME}}. Connecting to {{PRODUCTNAME}} is explained elsewhere in this document. Once a connection is established, the toolkit with its <idl>com.sun.star.awt.XExtendedToolkit</idl> interface can be used to retrieve a list of all currently open top-level windows. From these, you can then get the accessible root nodes of the accessibility object trees associated with the windows. When you register an <idl>com.sun.star.awt.XTopWindowListener</idl> you will then be informed about new top-level windows, as well as top-level windows that have disappeared.
  

Revision as of 13:16, 15 May 2009



When you are writing your own ATs and want to use the UNO accessibility API directly, you must first connect to OpenOffice.org. Connecting to OpenOffice.org is explained elsewhere in this document. Once a connection is established, the toolkit with its com.sun.star.awt.XExtendedToolkit interface can be used to retrieve a list of all currently open top-level windows. From these, you can then get the accessible root nodes of the accessibility object trees associated with the windows. When you register an com.sun.star.awt.XTopWindowListener you will then be informed about new top-level windows, as well as top-level windows that have disappeared.

With the top-level accessible objects at hand, you can use the Java version of the accessibility API as it is described in detail in the following sections. To be informed about focus changes - so that, for example, a screen reader can track the currently focused object and read it to the user - an AT has to register all non-transient objects of an accessibility tree.

The general operation of a simple AT consists of the following steps:

  1. Connect to OpenOffice.org.
  2. Retrieve the currently visible top-level windows and register as top window listener to keep the list up-to-date.
  3. Traverse the trees by getting their root elements from each window. See the description of the com.sun.star.accessibility.XAccessibleContext for a code example for this.
  4. Register each accessible object as com.sun.star.accessibility.XAccessibleEventListener.
  5. If called back with an com.sun.star.accessibility.AccessibleEventObject object, then process two kinds of events:
    • Events that denote a state change with either OldValue or NewValue containing the FOCUSED constant indicate that the source object of this event got either focused or unfocused.
    • When receiving events of type CHILD, register as listener at the object that is specified by the event, as well as all of the object's children.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages