Increment version to 1.7.0.
[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 #ifndef __ATK_COMPONENT_H__
21 #define __ATK_COMPONENT_H__
22
23 #include <atk/atkobject.h>
24 #include <atk/atkutil.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 /*
31  * The AtkComponent interface should be supported by any object that is 
32  * rendered on the screen. The interface provides the standard mechanism 
33  * for an assistive technology to determine and set the graphical
34  * representation of an object.
35  */
36
37 #define ATK_TYPE_COMPONENT                    (atk_component_get_type ())
38 #define ATK_IS_COMPONENT(obj)                 G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
39 #define ATK_COMPONENT(obj)                    G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
40 #define ATK_COMPONENT_GET_IFACE(obj)          (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
41
42 #ifndef _TYPEDEF_ATK_COMPONENT_
43 #define _TYPEDEF_ATK_COMPONENT_
44 typedef struct _AtkComponent AtkComponent;
45 #endif
46 typedef struct _AtkComponentIface  AtkComponentIface;
47
48 typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
49
50 typedef struct _AtkRectangle       AtkRectangle;
51
52 struct _AtkRectangle
53 {
54   gint x;
55   gint y;
56   gint width;
57   gint height;
58 };
59
60 struct _AtkComponentIface
61 {
62   GTypeInterface parent;
63
64   guint          (* add_focus_handler)  (AtkComponent          *component,
65                                          AtkFocusHandler        handler);
66
67   gboolean       (* contains)           (AtkComponent          *component,
68                                          gint                   x,
69                                          gint                   y,
70                                          AtkCoordType           coord_type);
71
72   AtkObject*    (* ref_accessible_at_point)  (AtkComponent     *component,
73                                          gint                   x,
74                                          gint                   y,
75                                          AtkCoordType           coord_type);
76   void          (* get_extents)         (AtkComponent          *component,
77                                          gint                  *x,
78                                          gint                  *y,
79                                          gint                  *width,
80                                          gint                  *height,
81                                          AtkCoordType          coord_type);
82   void                     (* get_position)     (AtkComponent   *component,
83                                                  gint           *x,
84                                                  gint           *y,
85                                                  AtkCoordType   coord_type);
86   void                     (* get_size)                 (AtkComponent   *component,
87                                                          gint           *width,
88                                                          gint           *height);
89   gboolean                 (* grab_focus)               (AtkComponent   *component);
90   void                     (* remove_focus_handler)      (AtkComponent  *component,
91                                                           guint         handler_id);
92   gboolean                 (* set_extents)      (AtkComponent   *component,
93                                                  gint           x,
94                                                  gint           y,
95                                                  gint           width,
96                                                  gint           height,
97                                                  AtkCoordType   coord_type);
98   gboolean                 (* set_position)     (AtkComponent   *component,
99                                                  gint           x,
100                                                  gint           y,
101                                                  AtkCoordType   coord_type);
102   gboolean                 (* set_size)         (AtkComponent   *component,
103                                                  gint           width,
104                                                  gint           height);
105         
106   AtkLayer                 (* get_layer)        (AtkComponent   *component);
107   gint                     (* get_mdi_zorder)   (AtkComponent   *component);
108
109   /*
110    * signal handlers
111    */
112   void                     (* bounds_changed)   (AtkComponent   *component,
113                                                  AtkRectangle   *bounds);
114   AtkFunction              pad2;
115 };
116
117 GType atk_component_get_type (void);
118
119 /* convenience functions */
120
121 guint                atk_component_add_focus_handler      (AtkComponent    *component,
122                                                            AtkFocusHandler handler);
123 gboolean              atk_component_contains               (AtkComponent    *component,
124                                                             gint            x,
125                                                             gint            y,
126                                                             AtkCoordType    coord_type);
127 AtkObject*            atk_component_ref_accessible_at_point(AtkComponent    *component,
128                                                             gint            x,
129                                                             gint            y,
130                                                             AtkCoordType    coord_type);
131 void                  atk_component_get_extents            (AtkComponent    *component,
132                                                             gint            *x,
133                                                             gint            *y,
134                                                             gint            *width,
135                                                             gint            *height,
136                                                             AtkCoordType    coord_type);
137 void                  atk_component_get_position           (AtkComponent    *component,
138                                                             gint            *x,
139                                                             gint            *y,
140                                                             AtkCoordType    coord_type);
141 void                  atk_component_get_size               (AtkComponent    *component,
142                                                             gint            *width,
143                                                             gint            *height);
144 AtkLayer              atk_component_get_layer              (AtkComponent    *component);
145 gint                  atk_component_get_mdi_zorder         (AtkComponent    *component);
146 gboolean              atk_component_grab_focus             (AtkComponent    *component);
147 void                  atk_component_remove_focus_handler   (AtkComponent    *component,
148                                                             guint           handler_id);
149 gboolean              atk_component_set_extents            (AtkComponent    *component,
150                                                             gint            x,
151                                                             gint            y,
152                                                             gint            width,
153                                                             gint            height,
154                                                             AtkCoordType    coord_type);
155 gboolean              atk_component_set_position           (AtkComponent    *component,
156                                                             gint            x,
157                                                             gint            y,
158                                                             AtkCoordType    coord_type);
159 gboolean              atk_component_set_size               (AtkComponent    *component,
160                                                             gint            width,
161                                                             gint            height);
162
163 #ifdef __cplusplus
164 }
165 #endif /* __cplusplus */
166
167
168 #endif /* __ATK_COMPONENT_H__ */