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