Listeners and Broadcasters

From Apache OpenOffice Wiki
Jump to: navigation, search



The com.sun.star.accessibility.XAccessibleEventBroadcaster and com.sun.star.accessibility.XAccessibleEventListener interface combo lets you register and unregister listeners. Events are represented by com.sun.star.accessibility.AccessibleEventObject structure. The different event types are listed and explained in the com.sun.star.accessibility.AccessibleEventId constants group.

Again, event types can be divided into two classes depending on whether they describe changes in the structure of the accessibility tree or changes in the internal state or the visual appearance of an accessible object. The first group consists of CHILD and INVALIDATE_ALL_CHILDREN. The first denotes a newly inserted or a removed child. The second is used in cases where more than one child has been inserted or removed and tells the listener to re-fetch a complete list of children.

The second group comprises all other event types. Typical members are VISIBLE_DATA_CHANGED and STATE_CHANGED, which inform listeners that the visual appearance of an object has changed (for example, to a different text color) or that one of its states has been switched on or off (for example, when an object becomes focused or selected).

The event types CONTROLLED_BY_RELATION_CHANGED, CONTROLLER_FOR_RELATION_CHANGED, LABEL_FOR_RELATION_CHANGED, LABELED_BY_RELATION_CHANGED, MEMBER_OF_RELATION_CHANGED, CONTENT_FLOWS_FROM_RELATION_CHANGED and CONTENT_FLOWS_TO_RELATION_CHANGED may be thought of as constituting a third group. They describe changes of the more virtual structure formed by relations between accessible objects in different parts of an accessibility tree.

Events are sent after the respective change of an accessible object took place. This enables the listener to retrieve up-to-date values that are sent with the event.

Documentation note.png A problem arises when the number of children becomes very large, as with Calc tables where the number of cells in a sheet is huge. Registering at every cell certainly is not an option. The solution to this problem is the introduction of the TRANSIENT state, which tells an AT not to register but to expect ACTIVE_DESCENDANT_CHANGED events sent from their parent. To prevent the AT from having to ask every child whether it is transient, the parent must set the MANAGES_DESCENDANTS state.
Content on this page is licensed under the Public Documentation License (PDL).
Personal tools
In other languages