add G_DISABLE_SINGLE_INCLUDES and ATK_DISABLE_SINGLE_INCLUDES to CPPFLAGS.
[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 typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
51
52 typedef struct _AtkRectangle       AtkRectangle;
53
54 struct _AtkRectangle
55 {
56   gint x;
57   gint y;
58   gint width;
59   gint height;
60 };
61
62 GType atk_rectangle_get_type (void);
63
64 #define ATK_TYPE_RECTANGLE (atk_rectangle_get_type ())
65 struct _AtkComponentIface
66 {
67   GTypeInterface parent;
68
69   guint          (* add_focus_handler)  (AtkComponent          *component,
70                                          AtkFocusHandler        handler);
71
72   gboolean       (* contains)           (AtkComponent          *component,
73                                          gint                   x,
74                                          gint                   y,
75                                          AtkCoordType           coord_type);
76
77   AtkObject*    (* ref_accessible_at_point)  (AtkComponent     *component,
78                                          gint                   x,
79                                          gint                   y,
80                                          AtkCoordType           coord_type);
81   void          (* get_extents)         (AtkComponent          *component,
82                                          gint                  *x,
83                                          gint                  *y,
84                                          gint                  *width,
85                                          gint                  *height,
86                                          AtkCoordType          coord_type);
87   void                     (* get_position)     (AtkComponent   *component,
88                                                  gint           *x,
89                                                  gint           *y,
90                                                  AtkCoordType   coord_type);
91   void                     (* get_size)                 (AtkComponent   *component,
92                                                          gint           *width,
93                                                          gint           *height);
94   gboolean                 (* grab_focus)               (AtkComponent   *component);
95   void                     (* remove_focus_handler)      (AtkComponent  *component,
96                                                           guint         handler_id);
97   gboolean                 (* set_extents)      (AtkComponent   *component,
98                                                  gint           x,
99                                                  gint           y,
100                                                  gint           width,
101                                                  gint           height,
102                                                  AtkCoordType   coord_type);
103   gboolean                 (* set_position)     (AtkComponent   *component,
104                                                  gint           x,
105                                                  gint           y,
106                                                  AtkCoordType   coord_type);
107   gboolean                 (* set_size)         (AtkComponent   *component,
108                                                  gint           width,
109                                                  gint           height);
110         
111   AtkLayer                 (* get_layer)        (AtkComponent   *component);
112   gint                     (* get_mdi_zorder)   (AtkComponent   *component);
113
114   /*
115    * signal handlers
116    */
117   void                     (* bounds_changed)   (AtkComponent   *component,
118                                                  AtkRectangle   *bounds);
119   gdouble                  (* get_alpha)        (AtkComponent   *component);
120 };
121
122 GType atk_component_get_type (void);
123
124 /* convenience functions */
125
126 guint                atk_component_add_focus_handler      (AtkComponent    *component,
127                                                            AtkFocusHandler handler);
128 gboolean              atk_component_contains               (AtkComponent    *component,
129                                                             gint            x,
130                                                             gint            y,
131                                                             AtkCoordType    coord_type);
132 AtkObject*            atk_component_ref_accessible_at_point(AtkComponent    *component,
133                                                             gint            x,
134                                                             gint            y,
135                                                             AtkCoordType    coord_type);
136 void                  atk_component_get_extents            (AtkComponent    *component,
137                                                             gint            *x,
138                                                             gint            *y,
139                                                             gint            *width,
140                                                             gint            *height,
141                                                             AtkCoordType    coord_type);
142 void                  atk_component_get_position           (AtkComponent    *component,
143                                                             gint            *x,
144                                                             gint            *y,
145                                                             AtkCoordType    coord_type);
146 void                  atk_component_get_size               (AtkComponent    *component,
147                                                             gint            *width,
148                                                             gint            *height);
149 AtkLayer              atk_component_get_layer              (AtkComponent    *component);
150 gint                  atk_component_get_mdi_zorder         (AtkComponent    *component);
151 gboolean              atk_component_grab_focus             (AtkComponent    *component);
152 void                  atk_component_remove_focus_handler   (AtkComponent    *component,
153                                                             guint           handler_id);
154 gboolean              atk_component_set_extents            (AtkComponent    *component,
155                                                             gint            x,
156                                                             gint            y,
157                                                             gint            width,
158                                                             gint            height,
159                                                             AtkCoordType    coord_type);
160 gboolean              atk_component_set_position           (AtkComponent    *component,
161                                                             gint            x,
162                                                             gint            y,
163                                                             AtkCoordType    coord_type);
164 gboolean              atk_component_set_size               (AtkComponent    *component,
165                                                             gint            width,
166                                                             gint            height);
167 gdouble               atk_component_get_alpha              (AtkComponent    *component);
168
169 G_END_DECLS
170
171 #endif /* __ATK_COMPONENT_H__ */