Release 2.15.1
[atk.git] / atk / atkcomponent.h
blob9a057efdf97ea4038299eb2110762ff42b49efc3
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 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
21 #error "Only <atk/atk.h> can be included directly."
22 #endif
24 #ifndef __ATK_COMPONENT_H__
25 #define __ATK_COMPONENT_H__
27 #include <atk/atkobject.h>
28 #include <atk/atkutil.h>
30 G_BEGIN_DECLS
33 * The AtkComponent interface should be supported by any object that is
34 * rendered on the screen. The interface provides the standard mechanism
35 * for an assistive technology to determine and set the graphical
36 * representation of an object.
39 #define ATK_TYPE_COMPONENT (atk_component_get_type ())
40 #define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
41 #define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
42 #define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
44 #ifndef _TYPEDEF_ATK_COMPONENT_
45 #define _TYPEDEF_ATK_COMPONENT_
46 typedef struct _AtkComponent AtkComponent;
47 #endif
48 typedef struct _AtkComponentIface AtkComponentIface;
50 /**
51 * AtkFocusHandler:
52 * @object: the #AtkObject that receives/lose the focus
53 * @focus_in: TRUE if the object receives the focus
55 * The type of callback function used for
56 * atk_component_add_focus_handler() and
57 * atk_component_remove_focus_handler()
59 * Deprecated: This type is deprecated since ATK version 2.9.4. as
60 * atk_component_add_focus_handler() and
61 * atk_component_remove_focus_handler() are deprecated. See those
62 * methods for more information.
64 typedef void (*AtkFocusHandler) (AtkObject* object, gboolean focus_in);
66 typedef struct _AtkRectangle AtkRectangle;
68 /**
69 * AtkRectangle:
70 * @x: X coordinate of the left side of the rectangle.
71 * @y: Y coordinate of the top side of the rectangle.
72 * @width: width of the rectangle.
73 * @height: height of the rectangle.
75 * A data structure for holding a rectangle. Those coordinates are
76 * relative to the component top-level parent.
78 struct _AtkRectangle
80 gint x;
81 gint y;
82 gint width;
83 gint height;
86 ATK_AVAILABLE_IN_ALL
87 GType atk_rectangle_get_type (void);
89 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
91 /**
92 * AtkComponentIface:
93 * @add_focus_handler: This virtual function is deprecated since 2.9.4
94 * and it should not be overriden. See
95 * atk_component_add_focus_handler() for more information.
96 * @get_position: This virtual function is deprecated since 2.12 and
97 * it should not be overriden. Use @get_extents instead.
98 * @get_size: This virtual function is deprecated since 2.12 and it
99 * should not be overriden. Use @get_extents instead.
100 * @remove_focus_handler: This virtual function is deprecated since
101 * 2.9.4 and it should not be overriden. See
102 * atk_component_remove_focus_handler() for more information.
105 struct _AtkComponentIface
107 GTypeInterface parent;
109 guint (* add_focus_handler) (AtkComponent *component,
110 AtkFocusHandler handler);
112 gboolean (* contains) (AtkComponent *component,
113 gint x,
114 gint y,
115 AtkCoordType coord_type);
117 AtkObject* (* ref_accessible_at_point) (AtkComponent *component,
118 gint x,
119 gint y,
120 AtkCoordType coord_type);
121 void (* get_extents) (AtkComponent *component,
122 gint *x,
123 gint *y,
124 gint *width,
125 gint *height,
126 AtkCoordType coord_type);
127 void (* get_position) (AtkComponent *component,
128 gint *x,
129 gint *y,
130 AtkCoordType coord_type);
131 void (* get_size) (AtkComponent *component,
132 gint *width,
133 gint *height);
134 gboolean (* grab_focus) (AtkComponent *component);
135 void (* remove_focus_handler) (AtkComponent *component,
136 guint handler_id);
137 gboolean (* set_extents) (AtkComponent *component,
138 gint x,
139 gint y,
140 gint width,
141 gint height,
142 AtkCoordType coord_type);
143 gboolean (* set_position) (AtkComponent *component,
144 gint x,
145 gint y,
146 AtkCoordType coord_type);
147 gboolean (* set_size) (AtkComponent *component,
148 gint width,
149 gint height);
151 AtkLayer (* get_layer) (AtkComponent *component);
152 gint (* get_mdi_zorder) (AtkComponent *component);
155 * signal handlers
157 void (* bounds_changed) (AtkComponent *component,
158 AtkRectangle *bounds);
159 gdouble (* get_alpha) (AtkComponent *component);
162 ATK_AVAILABLE_IN_ALL
163 GType atk_component_get_type (void);
165 /* convenience functions */
166 ATK_DEPRECATED_IN_2_10
167 guint atk_component_add_focus_handler (AtkComponent *component,
168 AtkFocusHandler handler);
169 ATK_AVAILABLE_IN_ALL
170 gboolean atk_component_contains (AtkComponent *component,
171 gint x,
172 gint y,
173 AtkCoordType coord_type);
174 ATK_AVAILABLE_IN_ALL
175 AtkObject* atk_component_ref_accessible_at_point(AtkComponent *component,
176 gint x,
177 gint y,
178 AtkCoordType coord_type);
179 ATK_AVAILABLE_IN_ALL
180 void atk_component_get_extents (AtkComponent *component,
181 gint *x,
182 gint *y,
183 gint *width,
184 gint *height,
185 AtkCoordType coord_type);
186 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents)
187 void atk_component_get_position (AtkComponent *component,
188 gint *x,
189 gint *y,
190 AtkCoordType coord_type);
191 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents)
192 void atk_component_get_size (AtkComponent *component,
193 gint *width,
194 gint *height);
195 ATK_AVAILABLE_IN_ALL
196 AtkLayer atk_component_get_layer (AtkComponent *component);
197 ATK_AVAILABLE_IN_ALL
198 gint atk_component_get_mdi_zorder (AtkComponent *component);
199 ATK_AVAILABLE_IN_ALL
200 gboolean atk_component_grab_focus (AtkComponent *component);
201 ATK_DEPRECATED_IN_2_10
202 void atk_component_remove_focus_handler (AtkComponent *component,
203 guint handler_id);
204 ATK_AVAILABLE_IN_ALL
205 gboolean atk_component_set_extents (AtkComponent *component,
206 gint x,
207 gint y,
208 gint width,
209 gint height,
210 AtkCoordType coord_type);
211 ATK_AVAILABLE_IN_ALL
212 gboolean atk_component_set_position (AtkComponent *component,
213 gint x,
214 gint y,
215 AtkCoordType coord_type);
216 ATK_AVAILABLE_IN_ALL
217 gboolean atk_component_set_size (AtkComponent *component,
218 gint width,
219 gint height);
220 ATK_AVAILABLE_IN_ALL
221 gdouble atk_component_get_alpha (AtkComponent *component);
223 G_END_DECLS
225 #endif /* __ATK_COMPONENT_H__ */