XAccessibleRelationSet

From Apache OpenOffice Wiki
Jump to: navigation, search



In addition to the parent-child relationship that defines the accessibility object tree, each accessible object may have one or more relations to other accessible objects, independent of that hierarchy. The types of possible relations are defined and explained in the com.sun.star.accessibility.AccessibleRelationType set of constants.

One example is the <idlml>com.sun.star.accessibility.AccessibleRelationType:LABEL_FOR</idlml> and <idlml>com.sun.star.accessibility.AccessibleRelationType:LABELED_BY</idlml> pair of relations that is used to express the case where one object is the label for a one or more controls of the GUI. The label and its controls may be spatially adjacent to make their relationship clear to the sighted user. But in the accessibility object tree, they may belong to different sub-trees. With a set of relations, these objects can be linked together.

Each relation is an com.sun.star.accessibility.AccessibleRelation structure that contains the relation type and a set of references to its target objects. In the previous example, there would be one <idlml>com.sun.star.accessibility.AccessibleRelationType:LABEL_FOR</idlml> relation for the label with all its controls in the target set and one <idlml>com.sun.star.accessibility.AccessibleRelationType:LABELED_BY</idlml> relation from each control to the label.

For each relation type there may be one relation belonging to a relation set as represented by the com.sun.star.accessibility.XAccessibleRelationSet interface. Therefore, the number of relations that is returned by getRelationCount() can not be greater than the number of relation types. Relations can be accessed either by calling the <idlml>com.sun.star.accessibility.XAccessibleRelationSet:getRelation</idlml>() function with an index, or by calling the <idlml>com.sun.star.accessibility.AccessibleRelation:RelationType</idlml>() function with a relation type. Note that there are no fixed mappings from relation types to indices. You can test whether a relation set contains a relation of a given type by using the <idlml>com.sun.star.accessibility.XAccessibleRelationSet:containsRelation</idlml>() function.

Template:Documentation/Note

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