From Apache OpenOffice Wiki
Jump to: navigation, search

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