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.
54 ATK_SCROLL_BOTTOM_RIGHT
,
56 ATK_SCROLL_BOTTOM_EDGE
,
58 ATK_SCROLL_RIGHT_EDGE
,
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
;
78 typedef struct _AtkComponentIface AtkComponentIface
;
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
;
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.
116 GType
atk_rectangle_get_type (void);
118 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
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.
134 struct _AtkComponentIface
136 GTypeInterface parent
;
138 guint (* add_focus_handler
) (AtkComponent
*component
,
139 AtkFocusHandler handler
);
141 gboolean (* contains
) (AtkComponent
*component
,
144 AtkCoordType coord_type
);
146 AtkObject
* (* ref_accessible_at_point
) (AtkComponent
*component
,
149 AtkCoordType coord_type
);
150 void (* get_extents
) (AtkComponent
*component
,
155 AtkCoordType coord_type
);
156 void (* get_position
) (AtkComponent
*component
,
159 AtkCoordType coord_type
);
160 void (* get_size
) (AtkComponent
*component
,
163 gboolean (* grab_focus
) (AtkComponent
*component
);
164 void (* remove_focus_handler
) (AtkComponent
*component
,
166 gboolean (* set_extents
) (AtkComponent
*component
,
171 AtkCoordType coord_type
);
172 gboolean (* set_position
) (AtkComponent
*component
,
175 AtkCoordType coord_type
);
176 gboolean (* set_size
) (AtkComponent
*component
,
180 AtkLayer (* get_layer
) (AtkComponent
*component
);
181 gint (* get_mdi_zorder
) (AtkComponent
*component
);
186 void (* bounds_changed
) (AtkComponent
*component
,
187 AtkRectangle
*bounds
);
188 gdouble (* get_alpha
) (AtkComponent
*component
);
191 * Scrolls this object so it becomes visible on the screen.
194 gboolean (*scroll_to
) (AtkComponent
*component
,
197 gboolean (*scroll_to_point
) (AtkComponent
*component
,
204 GType
atk_component_get_type (void);
206 /* convenience functions */
207 ATK_DEPRECATED_IN_2_10
208 guint
atk_component_add_focus_handler (AtkComponent
*component
,
209 AtkFocusHandler handler
);
211 gboolean
atk_component_contains (AtkComponent
*component
,
214 AtkCoordType coord_type
);
216 AtkObject
* atk_component_ref_accessible_at_point(AtkComponent
*component
,
219 AtkCoordType coord_type
);
221 void atk_component_get_extents (AtkComponent
*component
,
226 AtkCoordType coord_type
);
227 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents
)
228 void atk_component_get_position (AtkComponent
*component
,
231 AtkCoordType coord_type
);
232 ATK_DEPRECATED_IN_2_12_FOR(atk_component_get_extents
)
233 void atk_component_get_size (AtkComponent
*component
,
237 AtkLayer
atk_component_get_layer (AtkComponent
*component
);
239 gint
atk_component_get_mdi_zorder (AtkComponent
*component
);
241 gboolean
atk_component_grab_focus (AtkComponent
*component
);
242 ATK_DEPRECATED_IN_2_10
243 void atk_component_remove_focus_handler (AtkComponent
*component
,
246 gboolean
atk_component_set_extents (AtkComponent
*component
,
251 AtkCoordType coord_type
);
253 gboolean
atk_component_set_position (AtkComponent
*component
,
256 AtkCoordType coord_type
);
258 gboolean
atk_component_set_size (AtkComponent
*component
,
262 gdouble
atk_component_get_alpha (AtkComponent
*component
);
264 ATK_AVAILABLE_IN_2_30
265 gboolean
atk_component_scroll_to (AtkComponent
*component
,
268 ATK_AVAILABLE_IN_2_30
269 gboolean
atk_component_scroll_to_point (AtkComponent
*component
,
276 #endif /* __ATK_COMPONENT_H__ */