1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements.  See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership.  The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20 *************************************************************/
21
22
23
24#ifndef __com_sun_star_accessibility_XAccessibleContext_idl__
25#define __com_sun_star_accessibility_XAccessibleContext_idl__
26
27#ifndef __com_sun_star_accessibility_IllegalAccessibleComponentStateException_idl__
28#include <com/sun/star/accessibility/IllegalAccessibleComponentStateException.idl>
29#endif
30
31#ifndef __com_sun_star_lang_IndexOutOfBoundsException_idl__
32#include <com/sun/star/lang/IndexOutOfBoundsException.idl>
33#endif
34
35#ifndef __com_sun_star_beans_XPropertyChangeListener_idl__
36#include <com/sun/star/beans/XPropertyChangeListener.idl>
37#endif
38
39#ifndef __com_sun_star_lang_Locale_idl__
40#include <com/sun/star/lang/Locale.idl>
41#endif
42
43module com { module sun { module star { module accessibility {
44
45 published interface XAccessible;
46 published interface XAccessibleRelationSet;
47 published interface XAccessibleSelection;
48 published interface XAccessibleStateSet;
49
50/** Implement this interface for exposing various aspects of a class'
51    content.
52
53    <p>This interface serves two purposes: On the one hand it gives access
54    to the tree structure in which all accessible objects are
55    organized. Each node in this tree supports this interface.  On the other
56    hand it gives access to objects that expose the represented content.
57    That are role, state, name, description, and relations to other objects.
58    Take an OK button of a dialog as an example.  Its role is
59    <const>AccessibleRole::BUTTON</const>, its name is 'OK', and its description
60    is something like 'Accepts all changes made in the dialog'.</p>
61
62    @since OpenOffice 1.1.2
63*/
64published interface XAccessibleContext : ::com::sun::star::uno::XInterface
65{
66    /** Return the number of children.
67
68        <p>Returns the number of accessible children of the object.</p>
69
70        @return
71            The returned value is non-negative.
72    */
73    long getAccessibleChildCount();
74
75    /** Returns the i-th child of this object.
76
77        <p>The order in which the children are enumerated is implementation
78        dependend.</p>
79
80        @param i
81            The index may have any value.  If it is outside the range from 0
82            to n-1, with n being the number of children as returned by
83            <member>XAccessibleContext::getAccessibleChild</member> an empty
84            reference is returned.
85        @return
86            If the object has an i-th child the returned value is a
87            reference to that child.  Otherwise an empty reference is
88            returned.
89        @throws ::com::sun::star::lang::IndexOutOfBoundsException
90            If no child with the given index exists then an
91            <type scope="::com::sun::star::lang">IndexOutOfBoundsException</type>
92            exception is thrown.
93    */
94    XAccessible getAccessibleChild ([in] long i)
95        raises (::com::sun::star::lang::IndexOutOfBoundsException);
96
97    /** Returns the parent of this object.
98
99        <p>This function may be called for every node, including the root
100        node, of the accessible tree.</p>
101
102        @return
103            The returned reference points to a valid object for all but the
104            root node.  If called for the root node an empty reference is
105            returned.
106    */
107    XAccessible getAccessibleParent ();
108
109    /** Returns the index of this object in its accessible parent.
110
111        <p>If you call getAccessibeChild on the object's parent with the
112        index returned by this function you get a reference to this
113        object.</p>
114
115        @return
116           The returned index is zero based.
117    */
118    long getAccessibleIndexInParent ();
119
120    /** Returns the role of this object.
121
122        <p>The role is a generic description of an objects function.  The
123        relation between role and name is similar to the relation between
124        class and object.</p>
125
126        @return
127            The returned value is a role defined in the enumeration
128            AccessibleRole.
129
130        @see AccessibleRole
131            for a list of the available roles.
132    */
133    short getAccessibleRole ();
134
135    /** Returns the object's description.
136
137        <p>Returns the object's localized description.  The description should
138        complement the more generic descriptions given by an object's role
139        and name.</p>
140
141        @return
142            The returned string is the object's localized description.
143    */
144    string getAccessibleDescription ();
145
146    /** Return the object's localized name.
147
148        <p>See <member>XAccessibleContext::getAccessibleRole</member>'s
149        documentation for the relation between an object's name and role.
150        Names should be unique, at least between children of the same
151        parent, although the uniqueness is neither enforced nor used inside
152        the API.</p>
153
154        @return
155            The returned string is the object's localized name.
156    */
157    string  getAccessibleName ();
158
159    /** Returns the set of relations defined for this object.
160
161        <p>The returned set of relations is a copy of this objects relation
162        set: changing the returned object does not change this objects
163        relations.</p>
164
165        <p>aThere are two ways to represent an empty list of relations:
166        Return an empty reference or return a valid object that contains an
167        empty list.
168
169        @return
170           The returned value is either an empty reference or a reference to
171           a valid object that represents a copy of the objects list of
172           relations.
173    */
174    XAccessibleRelationSet getAccessibleRelationSet ();
175
176    /** Returns the set of states that are currently active for this
177        object.
178
179        <p>The returned state set is a copy: Changing the returned state set
180        will not be refelected by changing the object's set of states.  See
181        the documentation of <type>XAccessibleStateSet</type> for a
182        description of the individual states.</p>
183
184        @return
185            A reference to this object's state set or an empty reference if
186            states are not supported.
187
188        @see XAccessibleStateSet
189    */
190    XAccessibleStateSet getAccessibleStateSet ();
191
192    /** Returns the locale of the component.
193
194        <p>This locale is used for example to determine the language to use
195        for the name and description texts.</p>
196
197        @return
198            If this object does not have a locale, the locale of its parent
199            is returned.  If it does not have (yet) a parent it throws the
200            exception <type>IllegalAccessibleComponentStateException</type>.
201
202        @throws IllegalAccessibleComponentStateException
203            when this object does not (yet) have a parent.
204    */
205    ::com::sun::star::lang::Locale getLocale ()
206        raises (IllegalAccessibleComponentStateException);
207};
208
209}; }; }; };
210
211#endif
212