summaryrefslogtreecommitdiff
path: root/offapi/com/sun/star/accessibility/XAccessibleComponent.idl
blob: 583972cbf6c6109d4644961e9c08178086883e97 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
 * This file is part of the LibreOffice project.
 *
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
 *
 * This file incorporates work covered by the following license notice:
 *
 *   Licensed to the Apache Software Foundation (ASF) under one or more
 *   contributor license agreements. See the NOTICE file distributed
 *   with this work for additional information regarding copyright
 *   ownership. The ASF licenses this file to you under the Apache
 *   License, Version 2.0 (the "License"); you may not use this file
 *   except in compliance with the License. You may obtain a copy of
 *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 */

#ifndef __com_sun_star_accessibility_XAccessibleComponent_idl__
#define __com_sun_star_accessibility_XAccessibleComponent_idl__

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/awt/XFocusListener.idl>
#include <com/sun/star/awt/XFont.idl>
#include <com/sun/star/awt/FontDescriptor.idl>
#include <com/sun/star/awt/Point.idl>
#include <com/sun/star/awt/Rectangle.idl>
#include <com/sun/star/awt/Size.idl>
#include <com/sun/star/util/Color.idl>

module com { module sun { module star { module accessibility {

 interface XAccessible;

/** The <type>XAccessibleComponent</type> interface should be supported by
    any class that can be rendered on the screen.

    <p>This interface provides the standard mechanism for an assistive
    technology to retrieve information concerning the graphical
    representation of an object.  This interface combines methods from
    the Java interfaces <code>javax.accessibility.AccessibleComponent</code>
    and <code>javax.accessibility.AccessibleExtendedComponent</code>.</p>

    <p>Further information about the graphical appearance of an object can
    be expressed with the <type>XAccessibleExtendedComponent</type>
    interface.</p>

    <p>Coordinates used by the functions of this interface are specified in
    different coordinate systems.  Their scale is the same and is equal to
    that of the screen coordinate system.  In other words all coordinates
    are measured in pixel.  They differ in their respective origin:
    <ul><li>The screen coordinate system has its origin in the upper left
    corner of the current screen.  Used by the
    <method>getLocationOnScreen</method> function.</li>
    <li>The origin of the parent coordinate system is the upper left corner
    of the parent's bounding box.  With no parent the screen coordinate
    system is used instead.  Used by the <method>getLocation</method>
    function.</li>
    <li>The object coordinate system is relative to the upper left corner of
    an object's bounding box.  It is relative to itself so to speak.  Used
    by the <method>containsPoint</method> and
    <method>getAccessibleAtPoint</method> functions.</li>
    </ul></p>

    <p>Key bindings which are associated with an accessible component can be
    retrieved at the component's action.  The reason for this is that key
    bindings are associated with actions and directly with a component.
    This distinction becomes important when there are more than one action.
    To get access to the key bindings you have to get the
    <type>XAccessibleAction</type> interface of a component, provided that
    it is supported, and use the <method
    scope="XAccessibleAction">getAccessibleKeyBinding()</method>.</p>

    @see XAccessibleExtendedComponent

    @since OOo 1.1.2
*/
interface XAccessibleComponent : ::com::sun::star::uno::XInterface
{
    /** Tests whether the specified point lies within this object's bounds.

        <p>The test point's coordinates are defined relative to the
        coordinate system of the object.  That means that when the object is
        an opaque rectangle then both the points (0,0) and (with-1,height-1)
        would yield a <TRUE/> value.</p>

        @param point
            Coordinates of the point to test.  The origin of the coordinate
            system is the upper left corner of the object's bounding box as
            returned by the <method>getBounds</method>.  The scale of the
            coordinate system is identical to that of the screen coordinate
            system.

        @return
            Returns <TRUE/> if the point lies within or on the object's bounding
            box and <FALSE/> otherwise.
    */
    boolean containsPoint ([in] ::com::sun::star::awt::Point aPoint);

    /** Returns the Accessible child that is rendered under the given point.

        <p>The test point's coordinates are defined relative to the
        coordinate system of the object.  That means that when the object is
        an opaque rectangle then both the points (0,0) and (with-1,height-1)
        would yield a <TRUE/> value.</p>

        @param aPoint
            Coordinates of the test point for which to find the Accessible
            child.  The origin of the coordinate system is the upper left
            corner of the object's bounding box as returned by the
            <method>getBounds</method>.  The scale of the coordinate
            system is identical to that of the screen coordinate system.

        @return
            If there is one child which is rendered so that its bounding box
            contains the test point then a reference to that object is
            returned.  If there is more than one child which satisfies that
            condition then a reference to that one is returned that is
            painted on top of the others.  If no there is no child which is
            rendered at the test point an empty reference is returned.
    */
    XAccessible  getAccessibleAtPoint ([in] ::com::sun::star::awt::Point aPoint);

    /** Returns the bounding box of this object.

        <p>The returned bounding box has the form of a rectangle.  Its
        coordinates are relative to the object's parent coordinate system.
        Note that the two methods <method>getLocation</methodmber> and
        <method>getSize</method> return the same information.  With method
        <method>getLocationOnScreen</method> you can get the bound box
        position in screen coordinates.</p>

        @return
            The coordinates of the returned rectangle are relative to this
            object's parent or relative to the screen on which this object
            is rendered if it has no parent.  If the object is not on any
            screen the returned rectangle is empty and located at position
            (0,0).
    */
    ::com::sun::star::awt::Rectangle getBounds ();

    /** Returns the location of the upper left corner of the object's
        bounding box relative to the parent.</p>

        <p>The coordinates of the bounding box are given relative to the
        parent's coordinate system.</p>

        @return
            The coordinates of the returned position are relative to this
            object's parent or relative to the screen on which this object
            is rendered if it has no parent.  If the object is not on any
            screen the returned position is (0,0).
    */
    ::com::sun::star::awt::Point getLocation ();

    /** Returns the location of the upper left corner of the object's
        bounding box in screen coordinates.

        <p>This method returns the same point as does the method
        <method>getLocation</method>.  The difference is that the
        coordinates are absolute screen coordinates of the screen to which
        the object is rendered instead of being relative to the object's
        parent.</p>

        @return
            The coordinates of the returned position are relative to the
            screen on which this object is rendered.  If the object is not
            on any screen the returned position is (0,0).
    */
    ::com::sun::star::awt::Point getLocationOnScreen ();

    /** Returns the size of this object's bounding box.

        @return
            The returned size is the size of this object or empty if it is
            not rendered on any screen.
    */
    ::com::sun::star::awt::Size getSize();

    /** Grabs the focus to this object.

        <p>If this object can not accept the focus,
        i.e. <method>isFocusTraversable</method> returns <FALSE/> for this
        object then nothing happens.  Otherwise the object will attempt to
        take the focus.  Nothing happens if that fails, otherwise the object
        has the focus.  This method is called <code>requestFocus</code> in
        the Java Accessibility API 1.4.</p>
    */
    void grabFocus ();

    /** Returns the foreground color of this object.

        @return
            The returned color is the foreground color of this object or, if
            that is not supported, the default foreground color.
    */
    ::com::sun::star::util::Color getForeground ();

    /** Returns the background color of this object.

        @return
            The returned color is the background color of this object or, if
            that is not supported, the default background color.
    */
    ::com::sun::star::util::Color getBackground ();

};

}; }; }; };

#endif

/* vim:set shiftwidth=4 softtabstop=4 expandtab: */