Change argument of get_layer and get_mdi_zorder function pointers to be
[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
51 struct _AtkComponentIface
52 {
53   GTypeInterface parent;
54
55   guint          (* add_focus_handler)  (AtkComponent          *component,
56                                          AtkFocusHandler        handler);
57   gboolean       (* contains)           (AtkComponent          *component,
58                                          gint                   x,
59                                          gint                   y,
60                                          AtkCoordType           coord_type);
61
62   AtkObject*    (* ref_accessible_at_point)  (AtkComponent     *component,
63                                          gint                   x,
64                                          gint                   y,
65                                          AtkCoordType           coord_type);
66   void          (* get_extents)         (AtkComponent          *component,
67                                          gint                  *x,
68                                          gint                  *y,
69                                          gint                  *width,
70                                          gint                  *height,
71                                          AtkCoordType          coord_type);
72   void                     (* get_position)     (AtkComponent   *component,
73                                                  gint           *x,
74                                                  gint           *y,
75                                                  AtkCoordType   coord_type);
76   void                     (* get_size)                 (AtkComponent   *component,
77                                                          gint           *width,
78                                                          gint           *height);
79   gboolean                 (* grab_focus)               (AtkComponent   *component);
80   void                     (* remove_focus_handler)      (AtkComponent  *component,
81                                                           guint         handler_id);
82   gboolean                 (* set_extents)      (AtkComponent   *component,
83                                                  gint           x,
84                                                  gint           y,
85                                                  gint           width,
86                                                  gint           height,
87                                                  AtkCoordType   coord_type);
88   gboolean                 (* set_position)     (AtkComponent   *component,
89                                                  gint           x,
90                                                  gint           y,
91                                                  AtkCoordType   coord_type);
92   gboolean                 (* set_size)         (AtkComponent   *component,
93                                                  gint           width,
94                                                  gint           height);
95         
96   AtkLayer                 (* get_layer)        (AtkComponent   *component);
97   gint                     (* get_mdi_zorder)   (AtkComponent   *component);
98
99   AtkFunction              pad1;
100   AtkFunction              pad2;
101 };
102
103 GType atk_component_get_type (void);
104
105 /* convenience functions */
106
107 guint                atk_component_add_focus_handler      (AtkComponent    *component,
108                                                            AtkFocusHandler handler);
109 gboolean              atk_component_contains               (AtkComponent    *component,
110                                                             gint            x,
111                                                             gint            y,
112                                                             AtkCoordType    coord_type);
113 AtkObject*            atk_component_ref_accessible_at_point(AtkComponent    *component,
114                                                             gint            x,
115                                                             gint            y,
116                                                             AtkCoordType    coord_type);
117 void                  atk_component_get_extents            (AtkComponent    *component,
118                                                             gint            *x,
119                                                             gint            *y,
120                                                             gint            *width,
121                                                             gint            *height,
122                                                             AtkCoordType    coord_type);
123 void                  atk_component_get_position           (AtkComponent    *component,
124                                                             gint            *x,
125                                                             gint            *y,
126                                                             AtkCoordType    coord_type);
127 void                  atk_component_get_size               (AtkComponent    *component,
128                                                             gint            *width,
129                                                             gint            *height);
130 AtkLayer              atk_component_get_layer              (AtkComponent    *component);
131 gint                  atk_component_get_mdi_zorder         (AtkComponent    *component);
132 gboolean              atk_component_grab_focus             (AtkComponent    *component);
133 void                  atk_component_remove_focus_handler   (AtkComponent    *component,
134                                                             guint           handler_id);
135 gboolean              atk_component_set_extents            (AtkComponent    *component,
136                                                             gint            x,
137                                                             gint            y,
138                                                             gint            width,
139                                                             gint            height,
140                                                             AtkCoordType    coord_type);
141 gboolean              atk_component_set_position           (AtkComponent    *component,
142                                                             gint            x,
143                                                             gint            y,
144                                                             AtkCoordType    coord_type);
145 gboolean              atk_component_set_size               (AtkComponent    *component,
146                                                             gint            width,
147                                                             gint            height);
148
149 #ifdef __cplusplus
150 }
151 #endif /* __cplusplus */
152
153
154 #endif /* __ATK_COMPONENT_H__ */