Revert "Updated FSF's address"
[platform/upstream/atk.git] / atk / atkcomponent.h
1 /* ATK -  Accessibility Toolkit
2  * Copyright 2001 Sun Microsystems Inc.
3  *
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.
8  *
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.
13  *
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.
18  */
19
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
23
24 #ifndef __ATK_COMPONENT_H__
25 #define __ATK_COMPONENT_H__
26
27 #include <atk/atkobject.h>
28 #include <atk/atkutil.h>
29
30 G_BEGIN_DECLS
31
32 /*
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.
37  */
38
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))
43
44 #ifndef _TYPEDEF_ATK_COMPONENT_
45 #define _TYPEDEF_ATK_COMPONENT_
46 typedef struct _AtkComponent AtkComponent;
47 #endif
48 typedef struct _AtkComponentIface  AtkComponentIface;
49
50 /**
51  * AtkFocusHandler:
52  * @object: the #AtkObject that receives/lose the focus
53  * @focus_in: TRUE if the object receives the focus
54  *
55  * The type of callback function used for
56  * atk_component_add_focus_handler() and
57  * atk_component_remove_focus_handler()
58  *
59  * Deprecated: This type is deprecated since ATK version 2.9.4. as
60  * atk_component_add_focus_handler() and
61  * atk_component_remove_focus_handler() are deprecated. See those
62  * methods for more information.
63  */
64 typedef void (*AtkFocusHandler) (AtkObject* object, gboolean focus_in);
65
66 typedef struct _AtkRectangle       AtkRectangle;
67
68 /**
69  * AtkRectangle:
70  * @x: X coordinate of the left side of the rectangle.
71  * @y: Y coordinate of the top side of the rectangle.
72  * @width: width of the rectangle.
73  * @height: height of the rectangle.
74  *
75  * A data structure for holding a rectangle. Those coordinates are
76  * relative to the component top-level parent.
77  */
78 struct _AtkRectangle
79 {
80   gint x;
81   gint y;
82   gint width;
83   gint height;
84 };
85
86 GType atk_rectangle_get_type (void);
87
88 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
89
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  * @remove_focus_handler: This virtual function is deprecated since
96  * 2.9.4 and it should not be overriden. See
97  * atk_component_remove_focus_handler() for more information.
98  */
99
100 struct _AtkComponentIface
101 {
102   GTypeInterface parent;
103
104   guint          (* add_focus_handler)  (AtkComponent          *component,
105                                          AtkFocusHandler        handler);
106
107   gboolean       (* contains)           (AtkComponent          *component,
108                                          gint                   x,
109                                          gint                   y,
110                                          AtkCoordType           coord_type);
111
112   AtkObject*    (* ref_accessible_at_point)  (AtkComponent     *component,
113                                          gint                   x,
114                                          gint                   y,
115                                          AtkCoordType           coord_type);
116   void          (* get_extents)         (AtkComponent          *component,
117                                          gint                  *x,
118                                          gint                  *y,
119                                          gint                  *width,
120                                          gint                  *height,
121                                          AtkCoordType          coord_type);
122   void                     (* get_position)     (AtkComponent   *component,
123                                                  gint           *x,
124                                                  gint           *y,
125                                                  AtkCoordType   coord_type);
126   void                     (* get_size)                 (AtkComponent   *component,
127                                                          gint           *width,
128                                                          gint           *height);
129   gboolean                 (* grab_focus)               (AtkComponent   *component);
130   void                     (* remove_focus_handler)      (AtkComponent  *component,
131                                                           guint         handler_id);
132   gboolean                 (* set_extents)      (AtkComponent   *component,
133                                                  gint           x,
134                                                  gint           y,
135                                                  gint           width,
136                                                  gint           height,
137                                                  AtkCoordType   coord_type);
138   gboolean                 (* set_position)     (AtkComponent   *component,
139                                                  gint           x,
140                                                  gint           y,
141                                                  AtkCoordType   coord_type);
142   gboolean                 (* set_size)         (AtkComponent   *component,
143                                                  gint           width,
144                                                  gint           height);
145         
146   AtkLayer                 (* get_layer)        (AtkComponent   *component);
147   gint                     (* get_mdi_zorder)   (AtkComponent   *component);
148
149   /*
150    * signal handlers
151    */
152   void                     (* bounds_changed)   (AtkComponent   *component,
153                                                  AtkRectangle   *bounds);
154   gdouble                  (* get_alpha)        (AtkComponent   *component);
155 };
156
157 GType atk_component_get_type (void);
158
159 /* convenience functions */
160 G_DEPRECATED
161 guint                atk_component_add_focus_handler      (AtkComponent    *component,
162                                                            AtkFocusHandler handler);
163 gboolean              atk_component_contains               (AtkComponent    *component,
164                                                             gint            x,
165                                                             gint            y,
166                                                             AtkCoordType    coord_type);
167 AtkObject*            atk_component_ref_accessible_at_point(AtkComponent    *component,
168                                                             gint            x,
169                                                             gint            y,
170                                                             AtkCoordType    coord_type);
171 void                  atk_component_get_extents            (AtkComponent    *component,
172                                                             gint            *x,
173                                                             gint            *y,
174                                                             gint            *width,
175                                                             gint            *height,
176                                                             AtkCoordType    coord_type);
177 void                  atk_component_get_position           (AtkComponent    *component,
178                                                             gint            *x,
179                                                             gint            *y,
180                                                             AtkCoordType    coord_type);
181 void                  atk_component_get_size               (AtkComponent    *component,
182                                                             gint            *width,
183                                                             gint            *height);
184 AtkLayer              atk_component_get_layer              (AtkComponent    *component);
185 gint                  atk_component_get_mdi_zorder         (AtkComponent    *component);
186 gboolean              atk_component_grab_focus             (AtkComponent    *component);
187 G_DEPRECATED
188 void                  atk_component_remove_focus_handler   (AtkComponent    *component,
189                                                             guint           handler_id);
190 gboolean              atk_component_set_extents            (AtkComponent    *component,
191                                                             gint            x,
192                                                             gint            y,
193                                                             gint            width,
194                                                             gint            height,
195                                                             AtkCoordType    coord_type);
196 gboolean              atk_component_set_position           (AtkComponent    *component,
197                                                             gint            x,
198                                                             gint            y,
199                                                             AtkCoordType    coord_type);
200 gboolean              atk_component_set_size               (AtkComponent    *component,
201                                                             gint            width,
202                                                             gint            height);
203 gdouble               atk_component_get_alpha              (AtkComponent    *component);
204
205 G_END_DECLS
206
207 #endif /* __ATK_COMPONENT_H__ */