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