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

From Apache OpenOffice Wiki
Jump to: navigation, search
m (FINAL VERSION FOR L10N)
m (Correcting Wiki syntax error)
Line 12: Line 12:
 
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 <idl>com.sun.star.accessibility.AccessibleRelationType</idl> set of constants.
 
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 <idl>com.sun.star.accessibility.AccessibleRelationType</idl> 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.
+
One example is the <idlm>com.sun.star.accessibility.AccessibleRelationType:LABEL_FOR</idlm> and <idlm>com.sun.star.accessibility.AccessibleRelationType:LABELED_BY</idlm> 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 <idl>com.sun.star.accessibility.AccessibleRelation</idl> 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.
+
Each relation is an <idl>com.sun.star.accessibility.AccessibleRelation</idl> structure that contains the relation type and a set of references to its target objects. In the previous example, there would be one <idlm>com.sun.star.accessibility.AccessibleRelationType:LABEL_FOR</idlm> relation for the label with all its controls in the target set and one <idlm>com.sun.star.accessibility.AccessibleRelationType:LABELED_BY</idlm> 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 <idl>com.sun.star.accessibility.XAccessibleRelationSet</idl> interface. Therefore, the number of relations that is returned by <idlm>com.sun.star.accessibility.XAccessibleRelationSet:getRelationCount</idlm>() 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.
+
For each relation type there may be one relation belonging to a relation set as represented by the <idl>com.sun.star.accessibility.XAccessibleRelationSet</idl> interface. Therefore, the number of relations that is returned by <idlm>com.sun.star.accessibility.XAccessibleRelationSet:getRelationCount</idlm>() can not be greater than the number of relation types. Relations can be accessed either by calling the <idlm>com.sun.star.accessibility.XAccessibleRelationSet:getRelation</idlm>() function with an index, or by calling the <idlm>com.sun.star.accessibility.AccessibleRelation:RelationType</idlm>() 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 <idlm>com.sun.star.accessibility.XAccessibleRelationSet:containsRelation</idlm>() function.
  
 
{{Documentation/Note|The relation set returned by <idl>com.sun.star.accessibility.XAccessibleContext:getAccessibleRelationSet</idl>() returns a copy of the relation set of an accessible object. Modifying that copy does not change the relation set of the object.}}
 
{{Documentation/Note|The relation set returned by <idl>com.sun.star.accessibility.XAccessibleContext:getAccessibleRelationSet</idl>() returns a copy of the relation set of an accessible object. Modifying that copy does not change the relation set of the object.}}

Revision as of 17:35, 16 March 2012



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 LABEL_FOR and LABELED_BY 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 LABEL_FOR relation for the label with all its controls in the target set and one LABELED_BY 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 getRelation() function with an index, or by calling the RelationType() 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 containsRelation() function.

Template:Documentation/Note

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