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 #include <atk/atkobject.h>
27 #endif /* __cplusplus */
30 * The AtkComponent interface should be supported by any object that is
31 * rendered on the screen. The interface provides the standard mechanism
32 * for an assistive technology to determine and set the graphical
33 * representation of an object.
36 #define ATK_TYPE_COMPONENT (atk_component_get_type ())
37 #define ATK_IS_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
38 #define ATK_COMPONENT(obj) G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
39 #define ATK_COMPONENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
41 #ifndef _TYPEDEF_ATK_COMPONENT_
42 #define _TYPEDEF_ATK_COMPONENT_
43 typedef struct _AtkComponent AtkComponent;
45 typedef struct _AtkComponentIface AtkComponentIface;
47 typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
50 struct _AtkComponentIface
52 GTypeInterface parent;
55 * Add the specified handler to the set of functions to be called
56 * when this object receives focus (in or out) events.
58 guint (* add_focus_handler) (AtkComponent *component,
59 AtkFocusHandler handler);
61 * Checks whether the specified point is within the extent of the object,
62 * the points x and y coordinates are defined to be relative to the
63 * coordinate system of the object.
65 gboolean (* contains) (AtkComponent *component,
70 * Gets the accessible child, if one exists, contained at the local
71 * coordinate point specified by x and y.
73 AtkObject* (* get_accessible_at_point) (AtkComponent *component,
77 * Gets the rectangle which gives the extent of the object.
79 void (* get_extents) (AtkComponent *component,
85 * Gets the position of the object relative to the parent in the form of
86 * a point specifying the object's top-left corner in the screen's
89 void (* get_position) (AtkComponent *component,
93 * Returns the position of the object on the screen
95 void (* get_position_on_screen) (AtkComponent *component,
99 * Returns the size of the object
101 void (* get_size) (AtkComponent *component,
105 * Grabs focus for this object
107 void (* grab_focus) (AtkComponent *component);
109 * Remove the handler specified by the handler_id from the list of
110 * functions to be executed when this object receives focus (in or out)
112 void (* remove_focus_handler) (AtkComponent *component,
115 * Sets the extents of the object
117 void (* set_extents) (AtkComponent *component,
123 * Set the position of the object
125 void (* set_position) (AtkComponent *component,
129 * Set the size of the object
131 void (* set_size) (AtkComponent *component,
136 GType atk_component_get_type ();
138 /* convenience functions */
140 guint atk_component_add_focus_handler (AtkComponent *component,
141 AtkFocusHandler handler);
142 gboolean atk_component_contains (AtkComponent *component,
145 AtkObject* atk_component_get_accessible_at_point(AtkComponent *component,
148 void atk_component_get_extents (AtkComponent *component,
153 void atk_component_get_position (AtkComponent *component,
156 void atk_component_get_position_on_screen (AtkComponent *component,
159 void atk_component_get_size (AtkComponent *component,
162 void atk_component_grab_focus (AtkComponent *component);
163 void atk_component_remove_focus_handler (AtkComponent *component,
165 void atk_component_set_extents (AtkComponent *component,
170 void atk_component_set_position (AtkComponent *component,
173 void atk_component_set_size (AtkComponent *component,
179 #endif /* __cplusplus */
182 #endif /* __ATK_COMPONENT_H__ */