Updated FSF's address
[platform/upstream/atk.git] / atk / atktable.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, see <http://www.gnu.org/licenses/>.
16  */
17
18 #if defined(ATK_DISABLE_SINGLE_INCLUDES) && !defined (__ATK_H_INSIDE__) && !defined (ATK_COMPILATION)
19 #error "Only <atk/atk.h> can be included directly."
20 #endif
21
22 #ifndef __ATK_TABLE_H__
23 #define __ATK_TABLE_H__
24
25 #include <atk/atkobject.h>
26
27 G_BEGIN_DECLS
28
29 /*
30  * AtkTable describes a user-interface component that presents data in
31  * two-dimensional table format.
32  */
33
34
35 #define ATK_TYPE_TABLE                    (atk_table_get_type ())
36 #define ATK_IS_TABLE(obj)                 G_TYPE_CHECK_INSTANCE_TYPE ((obj), ATK_TYPE_TABLE)
37 #define ATK_TABLE(obj)                    G_TYPE_CHECK_INSTANCE_CAST ((obj), ATK_TYPE_TABLE, AtkTable)
38 #define ATK_TABLE_GET_IFACE(obj)          (G_TYPE_INSTANCE_GET_INTERFACE ((obj), ATK_TYPE_TABLE, AtkTableIface))
39
40 #ifndef _TYPEDEF_ATK_TABLE_
41 #define _TYPEDEF_ATK_TABLE_
42 typedef struct _AtkTable AtkTable;
43 #endif
44 typedef struct _AtkTableIface AtkTableIface;
45
46 struct _AtkTableIface
47 {
48   GTypeInterface parent;
49
50   AtkObject*        (* ref_at)                   (AtkTable      *table,
51                                                   gint          row,
52                                                   gint          column);
53   gint              (* get_index_at)             (AtkTable      *table,
54                                                   gint          row,
55                                                   gint          column);
56   gint              (* get_column_at_index)      (AtkTable      *table,
57                                                   gint          index_);
58   gint              (* get_row_at_index)         (AtkTable      *table,
59                                                   gint          index_);
60   gint              (* get_n_columns)           (AtkTable      *table);
61   gint              (* get_n_rows)               (AtkTable      *table);
62   gint              (* get_column_extent_at)     (AtkTable      *table,
63                                                   gint          row,
64                                                   gint          column);
65   gint              (* get_row_extent_at)        (AtkTable      *table,
66                                                   gint          row,
67                                                   gint          column);
68   AtkObject*
69                     (* get_caption)              (AtkTable      *table);
70   const gchar*      (* get_column_description)   (AtkTable      *table,
71                                                   gint          column);
72   AtkObject*        (* get_column_header)        (AtkTable      *table,
73                                                   gint          column);
74   const gchar*      (* get_row_description)      (AtkTable      *table,
75                                                   gint          row);
76   AtkObject*        (* get_row_header)           (AtkTable      *table,
77                                                   gint          row);
78   AtkObject*        (* get_summary)              (AtkTable      *table);
79   void              (* set_caption)              (AtkTable      *table,
80                                                   AtkObject     *caption);
81   void              (* set_column_description)   (AtkTable      *table,
82                                                   gint          column,
83                                                   const gchar   *description);
84   void              (* set_column_header)        (AtkTable      *table,
85                                                   gint          column,
86                                                   AtkObject     *header);
87   void              (* set_row_description)      (AtkTable      *table,
88                                                   gint          row,
89                                                   const gchar   *description);
90   void              (* set_row_header)           (AtkTable      *table,
91                                                   gint          row,
92                                                   AtkObject     *header);
93   void              (* set_summary)              (AtkTable      *table,
94                                                   AtkObject     *accessible);
95   gint              (* get_selected_columns)     (AtkTable      *table,
96                                                   gint          **selected);
97   gint              (* get_selected_rows)        (AtkTable      *table,
98                                                   gint          **selected);
99   gboolean          (* is_column_selected)       (AtkTable      *table,
100                                                   gint          column);
101   gboolean          (* is_row_selected)          (AtkTable      *table,
102                                                   gint          row);
103   gboolean          (* is_selected)              (AtkTable      *table,
104                                                   gint          row,
105                                                   gint          column);
106   gboolean          (* add_row_selection)        (AtkTable      *table,
107                                                   gint          row);
108   gboolean          (* remove_row_selection)     (AtkTable      *table,
109                                                   gint          row);
110   gboolean          (* add_column_selection)     (AtkTable      *table,
111                                                   gint          column);
112   gboolean          (* remove_column_selection)  (AtkTable      *table,
113                                                   gint          column);
114
115   /*
116    * signal handlers
117    */
118   void              (* row_inserted)             (AtkTable      *table,
119                                                   gint          row,
120                                                   gint          num_inserted);
121   void              (* column_inserted)          (AtkTable      *table,
122                                                   gint          column,
123                                                   gint          num_inserted);
124   void              (* row_deleted)              (AtkTable      *table,
125                                                   gint          row,
126                                                   gint          num_deleted);
127   void              (* column_deleted)           (AtkTable      *table,
128                                                   gint          column,
129                                                   gint          num_deleted);
130   void              (* row_reordered)            (AtkTable      *table);
131   void              (* column_reordered)         (AtkTable      *table);
132   void              (* model_changed)            (AtkTable      *table);
133 };
134
135 GType atk_table_get_type (void);
136
137 AtkObject*        atk_table_ref_at               (AtkTable         *table,
138                                                   gint             row,
139                                                   gint             column);
140 gint              atk_table_get_index_at         (AtkTable         *table,
141                                                   gint             row,
142                                                   gint             column);
143 gint              atk_table_get_column_at_index  (AtkTable         *table,
144                                                   gint             index_);
145 gint              atk_table_get_row_at_index     (AtkTable         *table,
146                                                   gint             index_);
147 gint              atk_table_get_n_columns        (AtkTable         *table);
148 gint              atk_table_get_n_rows           (AtkTable         *table);
149 gint              atk_table_get_column_extent_at (AtkTable         *table,
150                                                   gint             row,
151                                                   gint             column);
152 gint              atk_table_get_row_extent_at    (AtkTable         *table,
153                                                   gint             row,
154                                                   gint             column);
155 AtkObject*
156                   atk_table_get_caption          (AtkTable         *table);
157 const gchar*      atk_table_get_column_description
158                                                  (AtkTable         *table,
159                                                   gint             column);
160 AtkObject*        atk_table_get_column_header    (AtkTable         *table,
161                                                   gint             column);
162 const gchar*      atk_table_get_row_description  (AtkTable         *table,
163                                                   gint             row);
164 AtkObject*        atk_table_get_row_header       (AtkTable         *table,
165                                                   gint             row);
166 AtkObject*        atk_table_get_summary          (AtkTable         *table);
167 void              atk_table_set_caption          (AtkTable         *table,
168                                                   AtkObject        *caption);
169 void              atk_table_set_column_description 
170                                                  (AtkTable         *table,
171                                                   gint             column,
172                                                   const gchar      *description);
173 void              atk_table_set_column_header    (AtkTable         *table,
174                                                   gint             column,
175                                                   AtkObject        *header);
176 void              atk_table_set_row_description  (AtkTable         *table,
177                                                   gint             row,
178                                                   const gchar      *description);
179 void              atk_table_set_row_header       (AtkTable         *table,
180                                                   gint             row,
181                                                   AtkObject        *header);
182 void              atk_table_set_summary          (AtkTable         *table,
183                                                   AtkObject        *accessible);
184 gint              atk_table_get_selected_columns (AtkTable         *table,
185                                                   gint             **selected);
186 gint              atk_table_get_selected_rows    (AtkTable         *table,
187                                                   gint             **selected);
188 gboolean          atk_table_is_column_selected   (AtkTable         *table,
189                                                   gint             column);
190 gboolean          atk_table_is_row_selected      (AtkTable         *table,
191                                                   gint             row);
192 gboolean          atk_table_is_selected          (AtkTable         *table,
193                                                   gint             row,
194                                                   gint             column);
195 gboolean          atk_table_add_row_selection    (AtkTable         *table,
196                                                   gint             row);
197 gboolean          atk_table_remove_row_selection (AtkTable         *table,
198                                                   gint             row);
199 gboolean          atk_table_add_column_selection (AtkTable         *table,
200                                                   gint             column);
201 gboolean          atk_table_remove_column_selection  
202                                                  (AtkTable         *table,
203                                                   gint             column);
204
205 G_END_DECLS
206
207 #endif /* __ATK_TABLE_H__ */