Makefile-newvs: some .vcxproj.filters files are in builddir, some in srcdir
[atk.git] / atk / atkcomponent.h
blob9cc85ee40ff80224520d22a60cd18a2eea038a22
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: 2.9.4: Deprecated with atk_component_add_focus_handler()
60 * and atk_component_remove_focus_handler(). See those
61 * methods for more information.
63 typedef void (*AtkFocusHandler) (AtkObject* object, gboolean focus_in);
65 typedef struct _AtkRectangle AtkRectangle;
67 /**
68 * AtkRectangle:
69 * @x: X coordinate of the left side of the rectangle.
70 * @y: Y coordinate of the top side of the rectangle.
71 * @width: width of the rectangle.
72 * @height: height of the rectangle.
74 * A data structure for holding a rectangle. Those coordinates are
75 * relative to the component top-level parent.
77 struct _AtkRectangle
79 gint x;
80 gint y;
81 gint width;
82 gint height;
85 ATK_AVAILABLE_IN_ALL
86 GType atk_rectangle_get_type (void);
88 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
90 /**
91 * AtkComponentIface:
92 * @add_focus_handler: This virtual function is deprecated since 2.9.4
93 * and it should not be overriden. See
94 * atk_component_add_focus_handler() for more information.
95 * @get_position: This virtual function is deprecated since 2.12 and
96 * it should not be overriden. Use @get_extents instead.
97 * @get_size: This virtual function is deprecated since 2.12 and it
98 * should not be overriden. Use @get_extents instead.
99 * @remove_focus_handler: This virtual function is deprecated since
100 * 2.9.4 and it should not be overriden. See
101 * atk_component_remove_focus_handler() for more information.
104 struct _AtkComponentIface
106 GTypeInterface parent;
108 guint (* add_focus_handler) (AtkComponent *component,
109 AtkFocusHandler handler);
111 gboolean (* contains) (AtkComponent *component,
112 gint x,
113 gint y,
114 AtkCoordType coord_type);
116 AtkObject* (* ref_accessible_at_point) (AtkComponent *component,
117 gint x,
118 gint y,
119 AtkCoordType coord_type);
120 void (* get_extents) (AtkComponent *component,
121 gint *x,
122 gint *y,
123 gint *width,
124 gint *height,
125 AtkCoordType coord_type);
126 void (* get_position) (AtkComponent *component,
127 gint *x,
128 gint *y,
129 AtkCoordType coord_type);
130 void (* get_size) (AtkComponent *component,
131 gint *width,
132 gint *height);
133 gboolean (* grab_focus) (AtkComponent *component);
134 void (* remove_focus_handler) (AtkComponent *component,
135 guint handler_id);
136 gboolean (* set_extents) (AtkComponent *component,
137 gint x,
138 gint y,
139 gint width,
140 gint height,
141 AtkCoordType coord_type);
142 gboolean (* set_position) (AtkComponent *component,
143 gint x,
144 gint y,
145 AtkCoordType coord_type);
146 gboolean (* set_size) (AtkComponent *component,
147 gint width,
148 gint height);
150 AtkLayer (* get_layer) (AtkComponent *component);
151 gint (* get_mdi_zorder) (AtkComponent *component);
154 * signal handlers
156 void (* bounds_changed) (AtkComponent *component,
157 AtkRectangle *bounds);
158 gdouble (* get_alpha) (AtkComponent *component);
161 ATK_AVAILABLE_IN_ALL
162 GType atk_component_get_type (void);
164 /* convenience functions */
165 ATK_DEPRECATED_IN_2_10
166 guint atk_component_add_focus_handler (AtkComponent *component,
167 AtkFocusHandler handler);
168 ATK_AVAILABLE_IN_ALL
169 gboolean atk_component_contains (AtkComponent *component,
170 gint x,
171 gint y,
172 AtkCoordType coord_type);
173 ATK_AVAILABLE_IN_ALL
174 AtkObject* atk_component_ref_accessible_at_point(AtkComponent *component,
175 gint x,
176 gint y,
177 AtkCoordType coord_type);
178 ATK_AVAILABLE_IN_ALL
179 void atk_component_get_extents (AtkComponent *component,
180 gint *x,
181 gint *y,
182 gint *width,
183 gint *height,
184 AtkCoordType coord_type);
185 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents)
186 void atk_component_get_position (AtkComponent *component,
187 gint *x,
188 gint *y,
189 AtkCoordType coord_type);
190 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents)
191 void atk_component_get_size (AtkComponent *component,
192 gint *width,
193 gint *height);
194 ATK_AVAILABLE_IN_ALL
195 AtkLayer atk_component_get_layer (AtkComponent *component);
196 ATK_AVAILABLE_IN_ALL
197 gint atk_component_get_mdi_zorder (AtkComponent *component);
198 ATK_AVAILABLE_IN_ALL
199 gboolean atk_component_grab_focus (AtkComponent *component);
200 ATK_DEPRECATED_IN_2_10
201 void atk_component_remove_focus_handler (AtkComponent *component,
202 guint handler_id);
203 ATK_AVAILABLE_IN_ALL
204 gboolean atk_component_set_extents (AtkComponent *component,
205 gint x,
206 gint y,
207 gint width,
208 gint height,
209 AtkCoordType coord_type);
210 ATK_AVAILABLE_IN_ALL
211 gboolean atk_component_set_position (AtkComponent *component,
212 gint x,
213 gint y,
214 AtkCoordType coord_type);
215 ATK_AVAILABLE_IN_ALL
216 gboolean atk_component_set_size (AtkComponent *component,
217 gint width,
218 gint height);
219 ATK_AVAILABLE_IN_ALL
220 gdouble atk_component_get_alpha (AtkComponent *component);
222 G_END_DECLS
224 #endif /* __ATK_COMPONENT_H__ */