Deprecate AtkObject::focus-event signal and all related methods
[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 struct _AtkRectangle
69 {
70   gint x;
71   gint y;
72   gint width;
73   gint height;
74 };
75
76 GType atk_rectangle_get_type (void);
77
78 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
79
80 /**
81  * AtkComponentIface:
82  * @add_focus_handler: This virtual function is deprecated since 2.9.4
83  * and it should not be overriden. See
84  * atk_component_add_focus_handler() for more information.
85  * @remove_focus_handler: This virtual function is deprecated since
86  * 2.9.4 and it should not be overriden. See
87  * atk_component_remove_focus_handler() for more information.
88  */
89
90 struct _AtkComponentIface
91 {
92   GTypeInterface parent;
93
94   guint          (* add_focus_handler)  (AtkComponent          *component,
95                                          AtkFocusHandler        handler);
96
97   gboolean       (* contains)           (AtkComponent          *component,
98                                          gint                   x,
99                                          gint                   y,
100                                          AtkCoordType           coord_type);
101
102   AtkObject*    (* ref_accessible_at_point)  (AtkComponent     *component,
103                                          gint                   x,
104                                          gint                   y,
105                                          AtkCoordType           coord_type);
106   void          (* get_extents)         (AtkComponent          *component,
107                                          gint                  *x,
108                                          gint                  *y,
109                                          gint                  *width,
110                                          gint                  *height,
111                                          AtkCoordType          coord_type);
112   void                     (* get_position)     (AtkComponent   *component,
113                                                  gint           *x,
114                                                  gint           *y,
115                                                  AtkCoordType   coord_type);
116   void                     (* get_size)                 (AtkComponent   *component,
117                                                          gint           *width,
118                                                          gint           *height);
119   gboolean                 (* grab_focus)               (AtkComponent   *component);
120   void                     (* remove_focus_handler)      (AtkComponent  *component,
121                                                           guint         handler_id);
122   gboolean                 (* set_extents)      (AtkComponent   *component,
123                                                  gint           x,
124                                                  gint           y,
125                                                  gint           width,
126                                                  gint           height,
127                                                  AtkCoordType   coord_type);
128   gboolean                 (* set_position)     (AtkComponent   *component,
129                                                  gint           x,
130                                                  gint           y,
131                                                  AtkCoordType   coord_type);
132   gboolean                 (* set_size)         (AtkComponent   *component,
133                                                  gint           width,
134                                                  gint           height);
135         
136   AtkLayer                 (* get_layer)        (AtkComponent   *component);
137   gint                     (* get_mdi_zorder)   (AtkComponent   *component);
138
139   /*
140    * signal handlers
141    */
142   void                     (* bounds_changed)   (AtkComponent   *component,
143                                                  AtkRectangle   *bounds);
144   gdouble                  (* get_alpha)        (AtkComponent   *component);
145 };
146
147 GType atk_component_get_type (void);
148
149 /* convenience functions */
150 G_DEPRECATED
151 guint                atk_component_add_focus_handler      (AtkComponent    *component,
152                                                            AtkFocusHandler handler);
153 gboolean              atk_component_contains               (AtkComponent    *component,
154                                                             gint            x,
155                                                             gint            y,
156                                                             AtkCoordType    coord_type);
157 AtkObject*            atk_component_ref_accessible_at_point(AtkComponent    *component,
158                                                             gint            x,
159                                                             gint            y,
160                                                             AtkCoordType    coord_type);
161 void                  atk_component_get_extents            (AtkComponent    *component,
162                                                             gint            *x,
163                                                             gint            *y,
164                                                             gint            *width,
165                                                             gint            *height,
166                                                             AtkCoordType    coord_type);
167 void                  atk_component_get_position           (AtkComponent    *component,
168                                                             gint            *x,
169                                                             gint            *y,
170                                                             AtkCoordType    coord_type);
171 void                  atk_component_get_size               (AtkComponent    *component,
172                                                             gint            *width,
173                                                             gint            *height);
174 AtkLayer              atk_component_get_layer              (AtkComponent    *component);
175 gint                  atk_component_get_mdi_zorder         (AtkComponent    *component);
176 gboolean              atk_component_grab_focus             (AtkComponent    *component);
177 G_DEPRECATED
178 void                  atk_component_remove_focus_handler   (AtkComponent    *component,
179                                                             guint           handler_id);
180 gboolean              atk_component_set_extents            (AtkComponent    *component,
181                                                             gint            x,
182                                                             gint            y,
183                                                             gint            width,
184                                                             gint            height,
185                                                             AtkCoordType    coord_type);
186 gboolean              atk_component_set_position           (AtkComponent    *component,
187                                                             gint            x,
188                                                             gint            y,
189                                                             AtkCoordType    coord_type);
190 gboolean              atk_component_set_size               (AtkComponent    *component,
191                                                             gint            width,
192                                                             gint            height);
193 gdouble               atk_component_get_alpha              (AtkComponent    *component);
194
195 G_END_DECLS
196
197 #endif /* __ATK_COMPONENT_H__ */