Difference between revisions of "Documentation/DevGuide/Accessibility/Listeners and Broadcasters"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (1 revision(s))
m
Line 8: Line 8:
 
The <idl>com.sun.star.accessibility.XAccessibleEventBroadcaster</idl> and <idl>com.sun.star.accessibility.XAccessibleEventListener</idl> interface combo lets you register and unregister listeners. Events are represented by <idl>com.sun.star.accessibility.AccessibleEventObject</idl> structure. The different event types are listed and explained in the <idl>com.sun.star.accessibility.AccessibleEventId</idl> constants group.
 
The <idl>com.sun.star.accessibility.XAccessibleEventBroadcaster</idl> and <idl>com.sun.star.accessibility.XAccessibleEventListener</idl> interface combo lets you register and unregister listeners. Events are represented by <idl>com.sun.star.accessibility.AccessibleEventObject</idl> structure. The different event types are listed and explained in the <idl>com.sun.star.accessibility.AccessibleEventId</idl> 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 <idlm>com.sun.star.accessibility.AccessibleEventId:CHILD</idlm> and [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#INVALIDATE_ALL_CHILDREN 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.
+
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 <idlm>com.sun.star.accessibility.AccessibleEventId:CHILD</idlm> and <idlm>com.sun.star.accessibility.AccessibleEventId:INVALIDATE_ALL_CHILDREN</idlm>. 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 [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#VISIBLE_DATA_CHANGED VISIBLE_DATA_CHANGED] and [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#STATE_CHANGED 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 second group comprises all other event types. Typical members are <idlm>com.sun.star.accessibility.AccessibleEventId:VISIBLE_DATA_CHANGED</idlm> and <idlm>com.sun.star.accessibility.AccessibleEventId:STATE_CHANGED</idlm>, 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 [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#CONTROLLED_BY_RELATION_CHANGED CONTROLLED_BY_RELATION_CHANGED], [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#CONTROLLER_FOR_RELATION_CHANGED CONTROLLER_FOR_RELATION_CHANGED], [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#LABEL_FOR_RELATION_CHANGED LABEL_FOR_RELATION_CHANGED], [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#LABELED_BY_RELATION_CHANGED LABELED_BY_RELATION_CHANGED], [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#MEMBER_OF_RELATION_CHANGED MEMBER_OF_RELATION_CHANGED], [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#CONTENT_FLOWS_FROM_RELATION_CHANGED CONTENT_FLOWS_FROM_RELATION_CHANGED] and [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#CONTENT_FLOWS_TO_RELATION_CHANGED 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.
+
The event types <idlm>com.sun.star.accessibility.AccessibleEventId:CONTROLLED_BY_RELATION_CHANGED</idlm>, <idlm>com.sun.star.accessibility.AccessibleEventId:CONTROLLER_FOR_RELATION_CHANGED</idlm>, <idlm>com.sun.star.accessibility.AccessibleEventId:LABEL_FOR_RELATION_CHANGED</idlm>, <idlm>com.sun.star.accessibility.AccessibleEventId:LABELED_BY_RELATION_CHANGED</idlm>, <idlm>com.sun.star.accessibility.AccessibleEventId:MEMBER_OF_RELATION_CHANGED</idlm>, <idlm>com.sun.star.accessibility.AccessibleEventId:CONTENT_FLOWS_FROM_RELATION_CHANGED</idlm> and <idlm>com.sun.star.accessibility.AccessibleEventId:CONTENT_FLOWS_TO_RELATION_CHANGED</idlm> 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.
 
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|A problem arises when the number of children becomes very large, as with Calc tables where the number of cells is <nowiki>256??32000=8192000</nowiki>. Registering at every cell certainly is not an option. The solution to this problem is the introduction of the [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleStateType.html#TRANSIENT com.sun.star.accessibility.AccessibleStateType:TRANSIENT] state, which tells an AT not to register but to expect [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleEventId.html#ACTIVE_DESCENDANT_CHANGED com.sun.star.accessibility.AccessibleEventId: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 [http://api.openoffice.org/docs/common/ref/com/sun/star/accessibility/AccessibleStateType.html#MANAGES_DESCENDANTS com.sun.star.accessibility.AccessibleStateType:MANAGES_DESCENDANTS] state.}}
+
{{Documentation/Note|A problem arises when the number of children becomes very large, as with Calc tables where the number of cells is <nowiki>256??32000=8192000</nowiki>. Registering at every cell certainly is not an option. The solution to this problem is the introduction of the <idlml>com.sun.star.accessibility.AccessibleStateType:TRANSIENT</idlml> state, which tells an AT not to register but to expect <idlml>com.sun.star.accessibility.AccessibleEventId:ACTIVE_DESCENDANT_CHANGED</idlml> events sent from their parent. To prevent the AT from having to ask every child whether it is transient, the parent must set the <idlml>com.sun.star.accessibility.AccessibleStateType:MANAGES_DESCENDANTS</idlml> state.}}
  
 
{{PDL1}}
 
{{PDL1}}
 
[[Category: Accessibility]]
 
[[Category: Accessibility]]

Revision as of 19:22, 14 April 2008



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.

Template:Documentation/Note

Content on this page is licensed under the Public Documentation License (PDL).
Personal tools