Updated the atk docs for several files, particularly for enumerations.
[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
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
28
29 /*
30  * The AtkComponent interface should be supported by any object that is 
31  * rendered on the screen. The interface provides the standard mechanism 
32  * for an assistive technology to determine and set the graphical
33  * representation of an object.
34  */
35
36 #define ATK_TYPE_COMPONENT                    (atk_component_get_type ())
37 #define ATK_IS_COMPONENT(obj)                 G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_COMPONENT)
38 #define ATK_COMPONENT(obj)                    G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_COMPONENT, AtkComponent)
39 #define ATK_COMPONENT_GET_IFACE(obj)          (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_COMPONENT, AtkComponentIface))
40
41 #ifndef _TYPEDEF_ATK_COMPONENT_
42 #define _TYPEDEF_ATK_COMPONENT_
43 typedef struct _AtkComponent AtkComponent;
44 #endif
45 typedef struct _AtkComponentIface  AtkComponentIface;
46
47 typedef void (*AtkFocusHandler) (AtkObject*, gboolean);
48
49
50 struct _AtkComponentIface
51 {
52   GTypeInterface parent;
53
54   guint          (* add_focus_handler)  (AtkComponent    *component,
55                                          AtkFocusHandler handler);
56   gboolean       (* contains)           (AtkComponent           *component,
57                                          gint                   x,
58                                          gint                   y);
59
60   AtkObject*    (* get_accessible_at_point)  (AtkComponent     *component,
61                                          gint                   x,
62                                          gint                   y);
63   void          (* get_extents)         (AtkComponent          *component,
64                                          gint                  *x,
65                                          gint                  *y,
66                                          gint                  *width,
67                                          gint                  *height);
68   void                     (* get_position)     (AtkComponent   *component,
69                                                  gint           *x,
70                                                  gint           *y);
71   void                     (* get_position_on_screen)   (AtkComponent   *component,
72                                                          gint           *root_x,
73                                                          gint           *root_y);
74   void                     (* get_size)                 (AtkComponent   *component,
75                                                          gint           *width,
76                                                          gint           *height);
77   void                     (* grab_focus)               (AtkComponent   *component);
78   void                     (* remove_focus_handler)      (AtkComponent  *component,
79                                                           guint         handler_id);
80   void                     (* set_extents)      (AtkComponent   *component,
81                                                  gint           x,
82                                                  gint           y,
83                                                  gint           width,
84                                                  gint           height);
85   void                     (* set_position)     (AtkComponent   *component,
86                                                  gint           x,
87                                                  gint           y);
88   void                     (* set_size)         (AtkComponent   *component,
89                                                  gint           width,
90                                                  gint           height);
91 };
92
93 GType atk_component_get_type ();
94
95 /* convenience functions */
96
97 guint                atk_component_add_focus_handler      (AtkComponent    *component,
98                                                            AtkFocusHandler handler);
99 gboolean              atk_component_contains               (AtkComponent    *component,
100                                                             gint            x,
101                                                             gint            y);
102 AtkObject*            atk_component_get_accessible_at_point(AtkComponent    *component,
103                                                             gint            x,
104                                                             gint            y);
105 void                  atk_component_get_extents            (AtkComponent    *component,
106                                                             gint            *x,
107                                                             gint            *y,
108                                                             gint            *width,
109                                                             gint            *height);
110 void                  atk_component_get_position           (AtkComponent    *component,
111                                                             gint            *x,
112                                                             gint            *y);
113 void                  atk_component_get_position_on_screen (AtkComponent    *component,
114                                                             gint            *x,
115                                                             gint            *y);
116 void                  atk_component_get_size               (AtkComponent    *component,
117                                                             gint            *width,
118                                                             gint            *height);
119 void                  atk_component_grab_focus             (AtkComponent    *component);
120 void                  atk_component_remove_focus_handler   (AtkComponent    *component,
121                                                             guint           handler_id);
122 void                  atk_component_set_extents            (AtkComponent    *component,
123                                                             gint            x,
124                                                             gint            y,
125                                                             gint            width,
126                                                             gint            height);
127 void                  atk_component_set_position           (AtkComponent    *component,
128                                                             gint            x,
129                                                             gint            y);
130 void                  atk_component_set_size               (AtkComponent    *component,
131                                                             gint            width,
132                                                             gint            height);
133
134 #ifdef __cplusplus
135 }
136 #endif /* __cplusplus */
137
138
139 #endif /* __ATK_COMPONENT_H__ */