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;
46 typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
49 struct _AtkComponentIface
51 GTypeInterface parent;
54 * Add the specified handler to the set of functions to be called
55 * when this object receives focus (in or out) events.
57 guint (* add_focus_handler) (AtkComponent *component,
58 AtkFocusHandler handler);
60 * Checks whether the specified point is within the extent of the object,
61 * the points x and y coordinates are defined to be relative to the
62 * coordinate system of the object.
64 gboolean (* contains) (AtkComponent *component,
69 * Gets the accessible child, if one exists, contained at the local
70 * coordinate point specified by x and y.
72 AtkObject* (* get_accessible_at_point) (AtkComponent *component,
76 * Gets the rectangle which gives the extent of the object.
78 void (* get_extents) (AtkComponent *component,
84 * Gets the position of the object relative to the parent in the form of
85 * a point specifying the object's top-left corner in the screen's
88 void (* get_position) (AtkComponent *component,
92 * Returns the position of the object on the screen
94 void (* get_position_on_screen) (AtkComponent *component,
98 * Returns the size of the object
100 void (* get_size) (AtkComponent *component,
104 * Grabs focus for this object
106 void (* grab_focus) (AtkComponent *component);
108 * Remove the handler specified by the handler_id from the list of
109 * functions to be executed when this object receives focus (in or out)
111 void (* remove_focus_handler) (AtkComponent *component,
114 * Sets the extents of the object
116 void (* set_extents) (AtkComponent *component,
122 * Set the position of the object
124 void (* set_position) (AtkComponent *component,
128 * Set the size of the object
130 void (* set_size) (AtkComponent *component,
135 GType atk_component_get_type ();
137 /* convenience functions */
139 guint atk_component_add_focus_handler (AtkComponent *component,
140 AtkFocusHandler handler);
141 gboolean atk_component_contains (AtkComponent *component,
144 AtkObject* atk_component_get_accessible_at_point(AtkComponent *component,
147 void atk_component_get_extents (AtkComponent *component,
152 void atk_component_get_position (AtkComponent *component,
155 void atk_component_get_position_on_screen (AtkComponent *component,
158 void atk_component_get_size (AtkComponent *component,
161 void atk_component_grab_focus (AtkComponent *component);
162 void atk_component_remove_focus_handler (AtkComponent *component,
164 void atk_component_set_extents (AtkComponent *component,
169 void atk_component_set_position (AtkComponent *component,
172 void atk_component_set_size (AtkComponent *component,
178 #endif /* __cplusplus */
181 #endif /* __ATK_COMPONENT_H__ */