Difference between revisions of "Documentation/DevGuide/Accessibility/XAccessibleSelection"

From Apache OpenOffice Wiki
Jump to: navigation, search
m (FINAL VERSION FOR L10N)
m (Correcting Wiki syntax error)
 
Line 10: Line 10:
 
  {{DISPLAYTITLE:XAccessibleSelection}}
 
  {{DISPLAYTITLE:XAccessibleSelection}}
 
<!--<idltopic>com.sun.star.accessibility.XAccessibleSelection</idltopic>-->
 
<!--<idltopic>com.sun.star.accessibility.XAccessibleSelection</idltopic>-->
While the <idl>com.sun.star.accessibility.XAccessibleText</idl> and <idl>com.sun.star.accessibility.XAccessibleTable</idl> interfaces already support selection of text and table cells, respectively, there is a special interface for the general case. The <idls>com.sun.star.accessibility.XAccessibleSelection</idls> interface manages a sub-set of an object's children that form the selection. The number of selected children is returned by <idlm>com.sun.star.accessibility.XAccessibleSelection:getSelectedAccessibleChildCount</idlm>(), which, of course, is smaller than or equal to the total number of children as returned by <idlm>com.sun.star.accessibility.XAccessibleContext:getAccessibleChildCount</idlm>() of the <idl>com.sun.star.accessibility.XAccessibleContext</idl> interface. The selected children can be retrieved by calling the <idlm>com.sun.star.accessibility.XAccessibleSelection:getSelectedAccessibleChild</idlm>() function. Note that the same index passed to <idlm>com.sun.star.accessibility.XAccessibleSelection:getSelectedAccessibleChild</idlm>() and to <idlml>com.sun.star.accessibility.XAccessibleContext:getAccessibleChild</idlml>() will generally return different objects.
+
While the <idl>com.sun.star.accessibility.XAccessibleText</idl> and <idl>com.sun.star.accessibility.XAccessibleTable</idl> interfaces already support selection of text and table cells, respectively, there is a special interface for the general case. The <idls>com.sun.star.accessibility.XAccessibleSelection</idls> interface manages a sub-set of an object's children that form the selection. The number of selected children is returned by <idlm>com.sun.star.accessibility.XAccessibleSelection:getSelectedAccessibleChildCount</idlm>(), which, of course, is smaller than or equal to the total number of children as returned by <idlm>com.sun.star.accessibility.XAccessibleContext:getAccessibleChildCount</idlm>() of the <idl>com.sun.star.accessibility.XAccessibleContext</idl> interface. The selected children can be retrieved by calling the <idlm>com.sun.star.accessibility.XAccessibleSelection:getSelectedAccessibleChild</idlm>() function. Note that the same index passed to <idlm>com.sun.star.accessibility.XAccessibleSelection:getSelectedAccessibleChild</idlm>() and to <idlm>com.sun.star.accessibility.XAccessibleContext:getAccessibleChild</idlm>() will generally return different objects.
  
 
The selection can be modified with various functions. The functions <idlm>com.sun.star.accessibility.XAccessibleSelection:selectAllAccessibleChildren</idlm>() and <idlm>com.sun.star.accessibility.XAccessibleSelection:clearAccessibleSelection</idlm>() select or deselect, respectively, all of the children. To select or deselect a single child, use <idlm>com.sun.star.accessibility.XAccessibleSelection:selectAccessibleChild</idlm>() or <idlm>com.sun.star.accessibility.XAccessibleSelection:deselectAccessibleChild</idlm>(). Whether a child belongs to the selection can be determined by calling the <idlm>com.sun.star.accessibility.XAccessibleSelection:isAccessibleChildSelected</idlm>() function.
 
The selection can be modified with various functions. The functions <idlm>com.sun.star.accessibility.XAccessibleSelection:selectAllAccessibleChildren</idlm>() and <idlm>com.sun.star.accessibility.XAccessibleSelection:clearAccessibleSelection</idlm>() select or deselect, respectively, all of the children. To select or deselect a single child, use <idlm>com.sun.star.accessibility.XAccessibleSelection:selectAccessibleChild</idlm>() or <idlm>com.sun.star.accessibility.XAccessibleSelection:deselectAccessibleChild</idlm>(). Whether a child belongs to the selection can be determined by calling the <idlm>com.sun.star.accessibility.XAccessibleSelection:isAccessibleChildSelected</idlm>() function.
  
Each child that belongs to the selection is expected to have the <idlml>com.sun.star.accessibility.AccessibleStateType:SELECTED</idlml> state set. When the selection changes, two kinds of events are expected to be broadcast. One for each child that is selected or deselected that tells the listeners about the toggled <idlm>com.sun.star.accessibility.AccessibleStateType:SELECTED</idlm> state, and one event from their parent that informs the listeners of the modified selection as represented by the <idl>com.sun.star.accessibility.XAccessibleSelection</idl> interface.
+
Each child that belongs to the selection is expected to have the <idlm>com.sun.star.accessibility.AccessibleStateType:SELECTED</idlm> state set. When the selection changes, two kinds of events are expected to be broadcast. One for each child that is selected or deselected that tells the listeners about the toggled <idlm>com.sun.star.accessibility.AccessibleStateType:SELECTED</idlm> state, and one event from their parent that informs the listeners of the modified selection as represented by the <idl>com.sun.star.accessibility.XAccessibleSelection</idl> interface.
  
 
{{PDL1}}
 
{{PDL1}}
  
 
[[Category:Documentation/Developer's Guide/Accessibility]]
 
[[Category:Documentation/Developer's Guide/Accessibility]]

Latest revision as of 17:34, 16 March 2012



While the com.sun.star.accessibility.XAccessibleText and com.sun.star.accessibility.XAccessibleTable interfaces already support selection of text and table cells, respectively, there is a special interface for the general case. The XAccessibleSelection interface manages a sub-set of an object's children that form the selection. The number of selected children is returned by getSelectedAccessibleChildCount(), which, of course, is smaller than or equal to the total number of children as returned by getAccessibleChildCount() of the com.sun.star.accessibility.XAccessibleContext interface. The selected children can be retrieved by calling the getSelectedAccessibleChild() function. Note that the same index passed to getSelectedAccessibleChild() and to getAccessibleChild() will generally return different objects.

The selection can be modified with various functions. The functions selectAllAccessibleChildren() and clearAccessibleSelection() select or deselect, respectively, all of the children. To select or deselect a single child, use selectAccessibleChild() or deselectAccessibleChild(). Whether a child belongs to the selection can be determined by calling the isAccessibleChildSelected() function.

Each child that belongs to the selection is expected to have the SELECTED state set. When the selection changes, two kinds of events are expected to be broadcast. One for each child that is selected or deselected that tells the listeners about the toggled SELECTED state, and one event from their parent that informs the listeners of the modified selection as represented by the com.sun.star.accessibility.XAccessibleSelection interface.

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