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."
27 #include <atk/atkobject.h>
28 #include <atk/atkutil.h>
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
40 *@ATK_SCROLL_BOTTOM_EDGE: Scroll the object vertically to the bottom edge of
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.
56 ATK_SCROLL_BOTTOM_RIGHT
,
58 ATK_SCROLL_BOTTOM_EDGE
,
60 ATK_SCROLL_RIGHT_EDGE
,
65 * The AtkComponent interface should be supported by any object that is
66 * rendered on the screen. The interface provides the standard mechanism
67 * for an assistive technology to determine and set the graphical
68 * representation of an object.
71 #define ATK_TYPE_COMPONENT (atk_component_get_type ())
72 #define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
73 #define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
74 #define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
76 #ifndef _TYPEDEF_ATK_COMPONENT_
77 #define _TYPEDEF_ATK_COMPONENT_
78 typedef struct _AtkComponent AtkComponent
;
80 typedef struct _AtkComponentIface AtkComponentIface
;
84 * @object: the #AtkObject that receives/lose the focus
85 * @focus_in: TRUE if the object receives the focus
87 * The type of callback function used for
88 * atk_component_add_focus_handler() and
89 * atk_component_remove_focus_handler()
91 * Deprecated: 2.9.4: Deprecated with atk_component_add_focus_handler()
92 * and atk_component_remove_focus_handler(). See those
93 * methods for more information.
95 typedef void (*AtkFocusHandler
) (AtkObject
* object
, gboolean focus_in
);
97 typedef struct _AtkRectangle AtkRectangle
;
101 * @x: X coordinate of the left side of the rectangle.
102 * @y: Y coordinate of the top side of the rectangle.
103 * @width: width of the rectangle.
104 * @height: height of the rectangle.
106 * A data structure for holding a rectangle. Those coordinates are
107 * relative to the component top-level parent.
118 GType
atk_rectangle_get_type (void);
120 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
124 * @add_focus_handler: This virtual function is deprecated since 2.9.4
125 * and it should not be overriden. See
126 * atk_component_add_focus_handler() for more information.
127 * @get_position: This virtual function is deprecated since 2.12 and
128 * it should not be overriden. Use @get_extents instead.
129 * @get_size: This virtual function is deprecated since 2.12 and it
130 * should not be overriden. Use @get_extents instead.
131 * @remove_focus_handler: This virtual function is deprecated since
132 * 2.9.4 and it should not be overriden. See
133 * atk_component_remove_focus_handler() for more information.
136 struct _AtkComponentIface
138 GTypeInterface parent
;
140 guint (* add_focus_handler
) (AtkComponent
*component
,
141 AtkFocusHandler handler
);
143 gboolean (* contains
) (AtkComponent
*component
,
146 AtkCoordType coord_type
);
148 AtkObject
* (* ref_accessible_at_point
) (AtkComponent
*component
,
151 AtkCoordType coord_type
);
152 void (* get_extents
) (AtkComponent
*component
,
157 AtkCoordType coord_type
);
158 void (* get_position
) (AtkComponent
*component
,
161 AtkCoordType coord_type
);
162 void (* get_size
) (AtkComponent
*component
,
165 gboolean (* grab_focus
) (AtkComponent
*component
);
166 void (* remove_focus_handler
) (AtkComponent
*component
,
168 gboolean (* set_extents
) (AtkComponent
*component
,
173 AtkCoordType coord_type
);
174 gboolean (* set_position
) (AtkComponent
*component
,
177 AtkCoordType coord_type
);
178 gboolean (* set_size
) (AtkComponent
*component
,
182 AtkLayer (* get_layer
) (AtkComponent
*component
);
183 gint (* get_mdi_zorder
) (AtkComponent
*component
);
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.
196 gboolean (*scroll_to
) (AtkComponent
*component
,
199 gboolean (*scroll_to_point
) (AtkComponent
*component
,
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
);
213 gboolean
atk_component_contains (AtkComponent
*component
,
216 AtkCoordType coord_type
);
218 AtkObject
* atk_component_ref_accessible_at_point(AtkComponent
*component
,
221 AtkCoordType coord_type
);
223 void atk_component_get_extents (AtkComponent
*component
,
228 AtkCoordType coord_type
);
229 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents
)
230 void atk_component_get_position (AtkComponent
*component
,
233 AtkCoordType coord_type
);
234 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents
)
235 void atk_component_get_size (AtkComponent
*component
,
239 AtkLayer
atk_component_get_layer (AtkComponent
*component
);
241 gint
atk_component_get_mdi_zorder (AtkComponent
*component
);
243 gboolean
atk_component_grab_focus (AtkComponent
*component
);
244 ATK_DEPRECATED_IN_2_10
245 void atk_component_remove_focus_handler (AtkComponent
*component
,
248 gboolean
atk_component_set_extents (AtkComponent
*component
,
253 AtkCoordType coord_type
);
255 gboolean
atk_component_set_position (AtkComponent
*component
,
258 AtkCoordType coord_type
);
260 gboolean
atk_component_set_size (AtkComponent
*component
,
264 gdouble
atk_component_get_alpha (AtkComponent
*component
);
266 ATK_AVAILABLE_IN_2_30
267 gboolean
atk_component_scroll_to (AtkComponent
*component
,
270 ATK_AVAILABLE_IN_2_30
271 gboolean
atk_component_scroll_to_point (AtkComponent
*component
,
278 #endif /* __ATK_COMPONENT_H__ */