Added missing 2.30 Since tags
[atk.git] / atk / atkcomponent.h
blobfb5d2efc02d944586ca2eef2749be8f5f9cfb045
1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
20 #ifndef __ATK_COMPONENT_H__
21 #define __ATK_COMPONENT_H__
23 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
24 #error "Only <atk/atk.h> can be included directly."
25 #endif
27 #include <atk/atkobject.h>
28 #include <atk/atkutil.h>
30 G_BEGIN_DECLS
32 /**
33 *AtkScrollType:
34 *@ATK_SCROLL_TOP_LEFT: Scroll the object vertically and horizontally to the top
35 *left corner of the window.
36 *@ATK_SCROLL_BOTTOM_RIGHT: Scroll the object vertically and horizontally to the
37 *bottom right corner of the window.
38 *@ATK_SCROLL_TOP_EDGE: Scroll the object vertically to the top edge of the
39 window.
40 *@ATK_SCROLL_BOTTOM_EDGE: Scroll the object vertically to the bottom edge of
41 *the window.
42 *@ATK_SCROLL_LEFT_EDGE: Scroll the object vertically and horizontally to the
43 *left edge of the window.
44 *@ATK_SCROLL_RIGHT_EDGE: Scroll the object vertically and horizontally to the
45 *right edge of the window.
46 *@ATK_SCROLL_ANYWHERE: Scroll the object vertically and horizontally so that
47 *as much as possible of the object becomes visible. The exact placement is
48 *determined by the application.
50 * Specifies where an object should be placed on the screen when using scroll_to.
51 **/
52 typedef enum {
53 ATK_SCROLL_TOP_LEFT,
54 ATK_SCROLL_BOTTOM_RIGHT,
55 ATK_SCROLL_TOP_EDGE,
56 ATK_SCROLL_BOTTOM_EDGE,
57 ATK_SCROLL_LEFT_EDGE,
58 ATK_SCROLL_RIGHT_EDGE,
59 ATK_SCROLL_ANYWHERE
60 } AtkScrollType;
63 * The AtkComponent interface should be supported by any object that is
64 * rendered on the screen. The interface provides the standard mechanism
65 * for an assistive technology to determine and set the graphical
66 * representation of an object.
69 #define ATK_TYPE_COMPONENT (atk_component_get_type ())
70 #define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
71 #define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
72 #define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
74 #ifndef _TYPEDEF_ATK_COMPONENT_
75 #define _TYPEDEF_ATK_COMPONENT_
76 typedef struct _AtkComponent AtkComponent;
77 #endif
78 typedef struct _AtkComponentIface AtkComponentIface;
80 /**
81 * AtkFocusHandler:
82 * @object: the #AtkObject that receives/lose the focus
83 * @focus_in: TRUE if the object receives the focus
85 * The type of callback function used for
86 * atk_component_add_focus_handler() and
87 * atk_component_remove_focus_handler()
89 * Deprecated: 2.9.4: Deprecated with atk_component_add_focus_handler()
90 * and atk_component_remove_focus_handler(). See those
91 * methods for more information.
93 typedef void (*AtkFocusHandler) (AtkObject* object, gboolean focus_in);
95 typedef struct _AtkRectangle AtkRectangle;
97 /**
98 * AtkRectangle:
99 * @x: X coordinate of the left side of the rectangle.
100 * @y: Y coordinate of the top side of the rectangle.
101 * @width: width of the rectangle.
102 * @height: height of the rectangle.
104 * A data structure for holding a rectangle. Those coordinates are
105 * relative to the component top-level parent.
107 struct _AtkRectangle
109 gint x;
110 gint y;
111 gint width;
112 gint height;
115 ATK_AVAILABLE_IN_ALL
116 GType atk_rectangle_get_type (void);
118 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
121 * AtkComponentIface:
122 * @add_focus_handler: This virtual function is deprecated since 2.9.4
123 * and it should not be overriden. See
124 * atk_component_add_focus_handler() for more information.
125 * @get_position: This virtual function is deprecated since 2.12 and
126 * it should not be overriden. Use @get_extents instead.
127 * @get_size: This virtual function is deprecated since 2.12 and it
128 * should not be overriden. Use @get_extents instead.
129 * @remove_focus_handler: This virtual function is deprecated since
130 * 2.9.4 and it should not be overriden. See
131 * atk_component_remove_focus_handler() for more information.
133 * @Since: ATK-2.30
136 struct _AtkComponentIface
138 GTypeInterface parent;
140 guint (* add_focus_handler) (AtkComponent *component,
141 AtkFocusHandler handler);
143 gboolean (* contains) (AtkComponent *component,
144 gint x,
145 gint y,
146 AtkCoordType coord_type);
148 AtkObject* (* ref_accessible_at_point) (AtkComponent *component,
149 gint x,
150 gint y,
151 AtkCoordType coord_type);
152 void (* get_extents) (AtkComponent *component,
153 gint *x,
154 gint *y,
155 gint *width,
156 gint *height,
157 AtkCoordType coord_type);
158 void (* get_position) (AtkComponent *component,
159 gint *x,
160 gint *y,
161 AtkCoordType coord_type);
162 void (* get_size) (AtkComponent *component,
163 gint *width,
164 gint *height);
165 gboolean (* grab_focus) (AtkComponent *component);
166 void (* remove_focus_handler) (AtkComponent *component,
167 guint handler_id);
168 gboolean (* set_extents) (AtkComponent *component,
169 gint x,
170 gint y,
171 gint width,
172 gint height,
173 AtkCoordType coord_type);
174 gboolean (* set_position) (AtkComponent *component,
175 gint x,
176 gint y,
177 AtkCoordType coord_type);
178 gboolean (* set_size) (AtkComponent *component,
179 gint width,
180 gint height);
182 AtkLayer (* get_layer) (AtkComponent *component);
183 gint (* get_mdi_zorder) (AtkComponent *component);
186 * signal handlers
188 void (* bounds_changed) (AtkComponent *component,
189 AtkRectangle *bounds);
190 gdouble (* get_alpha) (AtkComponent *component);
193 * Scrolls this object so it becomes visible on the screen.
194 * Since ATK 2.30
196 gboolean (*scroll_to) (AtkComponent *component,
197 AtkScrollType type);
199 gboolean (*scroll_to_point) (AtkComponent *component,
200 AtkCoordType coords,
201 gint x,
202 gint y);
205 ATK_AVAILABLE_IN_ALL
206 GType atk_component_get_type (void);
208 /* convenience functions */
209 ATK_DEPRECATED_IN_2_10
210 guint atk_component_add_focus_handler (AtkComponent *component,
211 AtkFocusHandler handler);
212 ATK_AVAILABLE_IN_ALL
213 gboolean atk_component_contains (AtkComponent *component,
214 gint x,
215 gint y,
216 AtkCoordType coord_type);
217 ATK_AVAILABLE_IN_ALL
218 AtkObject* atk_component_ref_accessible_at_point(AtkComponent *component,
219 gint x,
220 gint y,
221 AtkCoordType coord_type);
222 ATK_AVAILABLE_IN_ALL
223 void atk_component_get_extents (AtkComponent *component,
224 gint *x,
225 gint *y,
226 gint *width,
227 gint *height,
228 AtkCoordType coord_type);
229 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents)
230 void atk_component_get_position (AtkComponent *component,
231 gint *x,
232 gint *y,
233 AtkCoordType coord_type);
234 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents)
235 void atk_component_get_size (AtkComponent *component,
236 gint *width,
237 gint *height);
238 ATK_AVAILABLE_IN_ALL
239 AtkLayer atk_component_get_layer (AtkComponent *component);
240 ATK_AVAILABLE_IN_ALL
241 gint atk_component_get_mdi_zorder (AtkComponent *component);
242 ATK_AVAILABLE_IN_ALL
243 gboolean atk_component_grab_focus (AtkComponent *component);
244 ATK_DEPRECATED_IN_2_10
245 void atk_component_remove_focus_handler (AtkComponent *component,
246 guint handler_id);
247 ATK_AVAILABLE_IN_ALL
248 gboolean atk_component_set_extents (AtkComponent *component,
249 gint x,
250 gint y,
251 gint width,
252 gint height,
253 AtkCoordType coord_type);
254 ATK_AVAILABLE_IN_ALL
255 gboolean atk_component_set_position (AtkComponent *component,
256 gint x,
257 gint y,
258 AtkCoordType coord_type);
259 ATK_AVAILABLE_IN_ALL
260 gboolean atk_component_set_size (AtkComponent *component,
261 gint width,
262 gint height);
263 ATK_AVAILABLE_IN_ALL
264 gdouble atk_component_get_alpha (AtkComponent *component);
266 ATK_AVAILABLE_IN_2_30
267 gboolean atk_component_scroll_to (AtkComponent *component,
268 AtkScrollType type);
270 ATK_AVAILABLE_IN_2_30
271 gboolean atk_component_scroll_to_point (AtkComponent *component,
272 AtkCoordType coords,
273 gint x,
274 gint y);
276 G_END_DECLS
278 #endif /* __ATK_COMPONENT_H__ */