1*b1cdbd2cSJim Jagielski/**************************************************************
2*b1cdbd2cSJim Jagielski *
3*b1cdbd2cSJim Jagielski * Licensed to the Apache Software Foundation (ASF) under one
4*b1cdbd2cSJim Jagielski * or more contributor license agreements.  See the NOTICE file
5*b1cdbd2cSJim Jagielski * distributed with this work for additional information
6*b1cdbd2cSJim Jagielski * regarding copyright ownership.  The ASF licenses this file
7*b1cdbd2cSJim Jagielski * to you under the Apache License, Version 2.0 (the
8*b1cdbd2cSJim Jagielski * "License"); you may not use this file except in compliance
9*b1cdbd2cSJim Jagielski * with the License.  You may obtain a copy of the License at
10*b1cdbd2cSJim Jagielski *
11*b1cdbd2cSJim Jagielski *   http://www.apache.org/licenses/LICENSE-2.0
12*b1cdbd2cSJim Jagielski *
13*b1cdbd2cSJim Jagielski * Unless required by applicable law or agreed to in writing,
14*b1cdbd2cSJim Jagielski * software distributed under the License is distributed on an
15*b1cdbd2cSJim Jagielski * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*b1cdbd2cSJim Jagielski * KIND, either express or implied.  See the License for the
17*b1cdbd2cSJim Jagielski * specific language governing permissions and limitations
18*b1cdbd2cSJim Jagielski * under the License.
19*b1cdbd2cSJim Jagielski *
20*b1cdbd2cSJim Jagielski *************************************************************/
21*b1cdbd2cSJim Jagielski
22*b1cdbd2cSJim Jagielski
23*b1cdbd2cSJim Jagielski
24*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_accessibility_XAccessibleComponent_idl__
25*b1cdbd2cSJim Jagielski#define __com_sun_star_accessibility_XAccessibleComponent_idl__
26*b1cdbd2cSJim Jagielski
27*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_uno_XInterface_idl__
28*b1cdbd2cSJim Jagielski#include <com/sun/star/uno/XInterface.idl>
29*b1cdbd2cSJim Jagielski#endif
30*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_XFocusListener_idl__
31*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/XFocusListener.idl>
32*b1cdbd2cSJim Jagielski#endif
33*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_XFont_idl__
34*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/XFont.idl>
35*b1cdbd2cSJim Jagielski#endif
36*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_FontDescriptor_idl__
37*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/FontDescriptor.idl>
38*b1cdbd2cSJim Jagielski#endif
39*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_Point_idl__
40*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/Point.idl>
41*b1cdbd2cSJim Jagielski#endif
42*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_Rectangle_idl__
43*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/Rectangle.idl>
44*b1cdbd2cSJim Jagielski#endif
45*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_awt_Size_idl__
46*b1cdbd2cSJim Jagielski#include <com/sun/star/awt/Size.idl>
47*b1cdbd2cSJim Jagielski#endif
48*b1cdbd2cSJim Jagielski#ifndef __com_sun_star_util_Color_idl__
49*b1cdbd2cSJim Jagielski#include <com/sun/star/util/Color.idl>
50*b1cdbd2cSJim Jagielski#endif
51*b1cdbd2cSJim Jagielski
52*b1cdbd2cSJim Jagielskimodule com { module sun { module star { module accessibility {
53*b1cdbd2cSJim Jagielski
54*b1cdbd2cSJim Jagielski published interface XAccessible;
55*b1cdbd2cSJim Jagielski
56*b1cdbd2cSJim Jagielski/** The <type>XAccessibleComponent</type> interface should be supported by
57*b1cdbd2cSJim Jagielski    any class that can be rendered on the screen.
58*b1cdbd2cSJim Jagielski
59*b1cdbd2cSJim Jagielski    <p>This interface provides the standard mechanism for an assistive
60*b1cdbd2cSJim Jagielski    technology to retrieve information concerning the graphical
61*b1cdbd2cSJim Jagielski    representation of an object.  This interface combines methods from
62*b1cdbd2cSJim Jagielski    the Java interfaces <code>javax.accessibility.AccessibleComponent</code>
63*b1cdbd2cSJim Jagielski    and <code>javax.accessibility.AccessibleExtendedComponent</code>.</p>
64*b1cdbd2cSJim Jagielski
65*b1cdbd2cSJim Jagielski    <p>Further information about the graphical appearance of an object can
66*b1cdbd2cSJim Jagielski    be expressed with the <type>XAccessibleExtendedComponent</type>
67*b1cdbd2cSJim Jagielski    interface.</p>
68*b1cdbd2cSJim Jagielski
69*b1cdbd2cSJim Jagielski    <p>Coordinates used by the functions of this interface are specified in
70*b1cdbd2cSJim Jagielski    different coordinate systems.  Their scale is the same and is equal to
71*b1cdbd2cSJim Jagielski    that of the screen coordiante system.  In other words all coordinates
72*b1cdbd2cSJim Jagielski    are measured in pixel.  They differ in their respective origin:
73*b1cdbd2cSJim Jagielski    <ul><li>The screen coordinate system has its origin in the upper left
74*b1cdbd2cSJim Jagielski    corner of the current screen.  Used by the
75*b1cdbd2cSJim Jagielski    <method>getLocationOnScreen</method> function.</li>
76*b1cdbd2cSJim Jagielski    <li>The origin of the parent coordinate system is the upper left corner
77*b1cdbd2cSJim Jagielski    of the parent's bounding box.  With no parent the screen coordinate
78*b1cdbd2cSJim Jagielski    system is used instead.  Used by the <method>getLocation</method>
79*b1cdbd2cSJim Jagielski    function.</li>
80*b1cdbd2cSJim Jagielski    <li>The object coordinate system is relative to the upper left corner of
81*b1cdbd2cSJim Jagielski    an object's bounding box.  It is relative to itself so to speak.  Used
82*b1cdbd2cSJim Jagielski    by the <method>containsPoint</method> and
83*b1cdbd2cSJim Jagielski    <method>getAccessibleAtPoint</method> functions.</li>
84*b1cdbd2cSJim Jagielski    </ul></p>
85*b1cdbd2cSJim Jagielski
86*b1cdbd2cSJim Jagielski    <p>Key bindings which are associated with an accessible component can be
87*b1cdbd2cSJim Jagielski    retrieved at the component's action.  The reason for this is that key
88*b1cdbd2cSJim Jagielski    bindings are associated with actions and directly with a component.
89*b1cdbd2cSJim Jagielski    This distinction becomes important when there are more than one action.
90*b1cdbd2cSJim Jagielski    To get access to the key bindings you have to get the
91*b1cdbd2cSJim Jagielski    <type>XAccessibleAction</type> interface of a component, provided that
92*b1cdbd2cSJim Jagielski    it is supported, and use the <method
93*b1cdbd2cSJim Jagielski    scope="XAccessibleAction">getAccessibleKeyBinding()</method>.</p>
94*b1cdbd2cSJim Jagielski
95*b1cdbd2cSJim Jagielski    @see XAccessibleExtendedComponent
96*b1cdbd2cSJim Jagielski
97*b1cdbd2cSJim Jagielski    @since OpenOffice 1.1.2
98*b1cdbd2cSJim Jagielski*/
99*b1cdbd2cSJim Jagielskipublished interface XAccessibleComponent : ::com::sun::star::uno::XInterface
100*b1cdbd2cSJim Jagielski{
101*b1cdbd2cSJim Jagielski    /** Tests whether the specified point lies within this object's bounds.
102*b1cdbd2cSJim Jagielski
103*b1cdbd2cSJim Jagielski        <p>The test point's coordinates are defined relative to the
104*b1cdbd2cSJim Jagielski        coordinate system of the object.  That means that when the object is
105*b1cdbd2cSJim Jagielski        an opaque rectangle then both the points (0,0) and (with-1,height-1)
106*b1cdbd2cSJim Jagielski        would yield a <TRUE/> value.</p>
107*b1cdbd2cSJim Jagielski
108*b1cdbd2cSJim Jagielski        @param point
109*b1cdbd2cSJim Jagielski            Coordinates of the point to test.  The origin of the coordinate
110*b1cdbd2cSJim Jagielski            system is the upper left corner of the object's bounding box as
111*b1cdbd2cSJim Jagielski            returned by the <method>getBounds</method>.  The scale of the
112*b1cdbd2cSJim Jagielski            coordinate system is identical to that of the screen coordiante
113*b1cdbd2cSJim Jagielski            system.
114*b1cdbd2cSJim Jagielski
115*b1cdbd2cSJim Jagielski        @return
116*b1cdbd2cSJim Jagielski            Returns <TRUE/> if the point lies within or on the object's bounding
117*b1cdbd2cSJim Jagielski            box and <FALSE/> otherwise.
118*b1cdbd2cSJim Jagielski    */
119*b1cdbd2cSJim Jagielski    boolean containsPoint ([in] ::com::sun::star::awt::Point aPoint);
120*b1cdbd2cSJim Jagielski
121*b1cdbd2cSJim Jagielski    /** Returns the Accessible child that is rendered under the given point.
122*b1cdbd2cSJim Jagielski
123*b1cdbd2cSJim Jagielski        <p>The test point's coordinates are defined relative to the
124*b1cdbd2cSJim Jagielski        coordinate system of the object.  That means that when the object is
125*b1cdbd2cSJim Jagielski        an opaque rectangle then both the points (0,0) and (with-1,height-1)
126*b1cdbd2cSJim Jagielski        would yield a <TRUE/> value.</p>
127*b1cdbd2cSJim Jagielski
128*b1cdbd2cSJim Jagielski        @param aPoint
129*b1cdbd2cSJim Jagielski            Coordinates of the test point for which to find the Accessible
130*b1cdbd2cSJim Jagielski            child.  The origin of the coordinate system is the upper left
131*b1cdbd2cSJim Jagielski            corner of the object's bounding box as returned by the
132*b1cdbd2cSJim Jagielski            <method>getBounds</method>.  The scale of the coordinate
133*b1cdbd2cSJim Jagielski            system is identical to that of the screen coordiante system.
134*b1cdbd2cSJim Jagielski
135*b1cdbd2cSJim Jagielski        @return
136*b1cdbd2cSJim Jagielski            If there is one child which is rendered so that its bounding box
137*b1cdbd2cSJim Jagielski            contains the test point then a reference to that object is
138*b1cdbd2cSJim Jagielski            returned.  If there is more than one child which satisfies that
139*b1cdbd2cSJim Jagielski            condition then a reference to that one is returned that is
140*b1cdbd2cSJim Jagielski            painted on top of the others.  If no there is no child which is
141*b1cdbd2cSJim Jagielski            rendered at the test point an empty reference is returned.
142*b1cdbd2cSJim Jagielski    */
143*b1cdbd2cSJim Jagielski    XAccessible  getAccessibleAtPoint ([in] ::com::sun::star::awt::Point aPoint);
144*b1cdbd2cSJim Jagielski
145*b1cdbd2cSJim Jagielski    /** Returns the bounding box of this object.
146*b1cdbd2cSJim Jagielski
147*b1cdbd2cSJim Jagielski        <p>The returned bounding box has the form of a rectangle.  Its
148*b1cdbd2cSJim Jagielski        coordinates are relative to the object's parent coordinate system.
149*b1cdbd2cSJim Jagielski        Note that the two methods <method>getLocation</methodmber> and
150*b1cdbd2cSJim Jagielski        <method>getSize</method> return the same information.  With method
151*b1cdbd2cSJim Jagielski        <method>getLocationOnScreen</method> you can get the bound box
152*b1cdbd2cSJim Jagielski        position in screen coordinates.</p>
153*b1cdbd2cSJim Jagielski
154*b1cdbd2cSJim Jagielski        @return
155*b1cdbd2cSJim Jagielski            The coordinates of the returned rectangle are relative to this
156*b1cdbd2cSJim Jagielski            object's parent or relative to the screen on which this object
157*b1cdbd2cSJim Jagielski            is rendered if it has no parent.  If the object is not on any
158*b1cdbd2cSJim Jagielski            screen the returnred rectangle is empty and located at position
159*b1cdbd2cSJim Jagielski            (0,0).
160*b1cdbd2cSJim Jagielski    */
161*b1cdbd2cSJim Jagielski    ::com::sun::star::awt::Rectangle getBounds ();
162*b1cdbd2cSJim Jagielski
163*b1cdbd2cSJim Jagielski    /** Returns the location of the upper left corner of the object's
164*b1cdbd2cSJim Jagielski        bounding box relative to the parent.</p>
165*b1cdbd2cSJim Jagielski
166*b1cdbd2cSJim Jagielski        <p>The coordinates of the bounding box are given relative to the
167*b1cdbd2cSJim Jagielski        parent's coordinate system.</p>
168*b1cdbd2cSJim Jagielski
169*b1cdbd2cSJim Jagielski        @return
170*b1cdbd2cSJim Jagielski            The coordinates of the returned position are relative to this
171*b1cdbd2cSJim Jagielski            object's parent or relative to the screen on which this object
172*b1cdbd2cSJim Jagielski            is rendered if it has no parent.  If the object is not on any
173*b1cdbd2cSJim Jagielski            screen the returnred position is (0,0).
174*b1cdbd2cSJim Jagielski    */
175*b1cdbd2cSJim Jagielski    ::com::sun::star::awt::Point getLocation ();
176*b1cdbd2cSJim Jagielski
177*b1cdbd2cSJim Jagielski    /** Returns the location of the upper left corner of the object's
178*b1cdbd2cSJim Jagielski        bounding box in screen coordinates.
179*b1cdbd2cSJim Jagielski
180*b1cdbd2cSJim Jagielski        <p>This method returns the same point as does the method
181*b1cdbd2cSJim Jagielski        <method>getLocation</method>.  The difference is that the
182*b1cdbd2cSJim Jagielski        coordinates are absolute screen coordinates of the screen to which
183*b1cdbd2cSJim Jagielski        the object is rendered instead of being relative to the object's
184*b1cdbd2cSJim Jagielski        parent.</p>
185*b1cdbd2cSJim Jagielski
186*b1cdbd2cSJim Jagielski        @return
187*b1cdbd2cSJim Jagielski            The coordinates of the returned position are relative to the
188*b1cdbd2cSJim Jagielski            screen on which this object is rendered.  If the object is not
189*b1cdbd2cSJim Jagielski            on any screen the returnred position is (0,0).
190*b1cdbd2cSJim Jagielski    */
191*b1cdbd2cSJim Jagielski    ::com::sun::star::awt::Point getLocationOnScreen ();
192*b1cdbd2cSJim Jagielski
193*b1cdbd2cSJim Jagielski    /** Returns the size of this object's bounding box.
194*b1cdbd2cSJim Jagielski
195*b1cdbd2cSJim Jagielski        @return
196*b1cdbd2cSJim Jagielski            The returned size is the size of this object or empty if it is
197*b1cdbd2cSJim Jagielski            not rendered on any screen.
198*b1cdbd2cSJim Jagielski    */
199*b1cdbd2cSJim Jagielski    ::com::sun::star::awt::Size getSize();
200*b1cdbd2cSJim Jagielski
201*b1cdbd2cSJim Jagielski    /** Grabs the focus to this object.
202*b1cdbd2cSJim Jagielski
203*b1cdbd2cSJim Jagielski        <p>If this object can not accept the focus,
204*b1cdbd2cSJim Jagielski        i.e. <method>isFocusTraversable</method> returns <FALSE/> for this
205*b1cdbd2cSJim Jagielski        object then nothing happens.  Otherwise the object will attempt to
206*b1cdbd2cSJim Jagielski        take the focus.  Nothing happens if that fails, otherwise the object
207*b1cdbd2cSJim Jagielski        has the focus.  This method is called <code>requestFocus</code> in
208*b1cdbd2cSJim Jagielski        the Java Accessibility API 1.4.</p>
209*b1cdbd2cSJim Jagielski    */
210*b1cdbd2cSJim Jagielski    [oneway] void grabFocus ();
211*b1cdbd2cSJim Jagielski
212*b1cdbd2cSJim Jagielski    /** Returns the foreground color of this object.
213*b1cdbd2cSJim Jagielski
214*b1cdbd2cSJim Jagielski        @return
215*b1cdbd2cSJim Jagielski            The returned color is the foreground color of this object or, if
216*b1cdbd2cSJim Jagielski            that is not supported, the default foreground color.
217*b1cdbd2cSJim Jagielski    */
218*b1cdbd2cSJim Jagielski    ::com::sun::star::util::Color getForeground ();
219*b1cdbd2cSJim Jagielski
220*b1cdbd2cSJim Jagielski    /** Returns the background color of this object.
221*b1cdbd2cSJim Jagielski
222*b1cdbd2cSJim Jagielski        @return
223*b1cdbd2cSJim Jagielski            The returned color is the background color of this object or, if
224*b1cdbd2cSJim Jagielski            that is not supported, the default background color.
225*b1cdbd2cSJim Jagielski    */
226*b1cdbd2cSJim Jagielski    ::com::sun::star::util::Color getBackground ();
227*b1cdbd2cSJim Jagielski
228*b1cdbd2cSJim Jagielski};
229*b1cdbd2cSJim Jagielski
230*b1cdbd2cSJim Jagielski}; }; }; };
231*b1cdbd2cSJim Jagielski
232*b1cdbd2cSJim Jagielski#endif
233