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