3ccdd98ac70ef8544adffe2478cf08d3b8f851f2
[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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __ATK_TABLE_H__
21 #define __ATK_TABLE_H__
22
23 #include <atk/atkobject.h>
24
25 #ifdef __cplusplus
26 extern "C" {
27 #endif /* __cplusplus */
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
45 struct _AtkTableIface
46 {
47   GTypeInterface parent;
48
49   /*
50    * Returns a reference to the accessible object at a specified row 
51    * and column in the table.
52    */
53   AtkObject*        (* ref_at)                   (AtkTable      *table,
54                                                   gint          row,
55                                                   gint          column);
56   gint              (* get_index_at)             (AtkTable      *table,
57                                                   gint          row,
58                                                   gint          column);
59   gint              (* get_row_at_index)         (AtkTable      *table,
60                                                   gint          index);
61   gint              (* get_column_at_index)      (AtkTable      *table,
62                                                   gint          index);
63   /*
64    * Returns the caption for the table.
65    */
66   AtkObject*        (* get_caption)              (AtkTable      *table);
67   /*
68    * Returns the number of columns in the table.
69    */
70   gint              (* get_n_columns)           (AtkTable      *table);
71   /*
72    * Returns the description text of the specified column in the table
73    */
74   AtkObject*        (* get_column_description)   (AtkTable      *table,
75                                                   gint          column);
76   /*
77    * Returns the number of columns occupied by the accessible object
78    * at a specified row and column in the table.
79    */
80   gint              (* get_column_extent_at)     (AtkTable      *table,
81                                                   gint          row,
82                                                   gint          column);
83   /*
84    * Returns the column headers of an accessible table.
85    */
86   AtkTable*         (* get_column_header)        (AtkTable      *table);
87   /*
88    * Returns the number of rows in the table.
89    */
90   gint              (* get_n_rows)               (AtkTable      *table);
91   /*
92    * Returns the description text of the specified row in the table
93    */
94   AtkObject*        (* get_row_description)      (AtkTable      *table,
95                                                   gint          row);
96   /*
97    * Returns the number of rows occupied by the accessible object
98    * at a specified row and column in the table.
99    */
100   gint              (* get_row_extent_at)        (AtkTable      *table,
101                                                   gint          row,
102                                                   gint          column);
103   /*
104    * Returns the row headers of an accessible table.
105    */
106   AtkTable*         (* get_row_header)           (AtkTable      *table);
107   /*
108    * Returns the summary description of the table.
109    */
110   AtkObject*        (* get_summary)              (AtkTable      *table);
111   /*
112    * Returns the selected columns of the table.
113    */
114   gint*             (* get_selected_columns)     (AtkTable      *table);
115   /*
116    * Returns the selected rows of the table.
117    */
118   gint*             (* get_selected_rows)        (AtkTable      *table);
119   /*
120    * Returns a boolean value indicating whether the specified column
121    * is selected
122    */
123   gboolean          (* is_column_selected)       (AtkTable      *table,
124                                                   gint          column);
125   /*
126    * Returns a boolean value indicating whether the specified row
127    * is selected
128    */
129   gboolean          (* is_row_selected)          (AtkTable      *table,
130                                                   gint          row);
131   /*
132    * Returns a boolean value indicating whether the acessible object
133    * at the specified row and column is selected
134    */
135   gboolean          (* is_selected)              (AtkTable      *table,
136                                                   gint          row,
137                                                   gint          column);
138   /*
139    * Sets the caption for the table.
140    */
141   void              (* set_caption)              (AtkTable      *table,
142                                                   AtkObject     *accessible);
143   /*
144    * Sets the description text for the specified column of the table.
145    */
146   void              (* set_column_description)   (AtkTable      *table,
147                                                   gint          column,
148                                                   AtkObject     *accessible);
149   /*
150    * Sets the column headers
151    */
152   void              (* set_column_header)        (AtkTable      *table,
153                                                   gint          column,
154                                                   AtkTable      *header);
155   /*
156    * Sets the description text for the specified row of the table.
157    */
158   void              (* set_row_description)      (AtkTable      *table,
159                                                   gint          row,
160                                                   AtkObject     *accessible);
161   /*
162    * Sets the row headers
163    */
164   void              (* set_row_header)           (AtkTable      *table,
165                                                   gint          row,
166                                                   AtkTable      *header);
167   /*
168    * Sets the summary description of the table
169    */
170   void              (* set_summary)              (AtkTable      *table,
171                                                   AtkObject     *accessible);
172 };
173
174 GType atk_table_get_type ();
175
176 AtkObject*        atk_table_ref_at               (AtkTable         *table,
177                                                   gint             row,
178                                                   gint             column);
179 gint              atk_table_get_index_at         (AtkTable         *table,
180                                                   gint             row,
181                                                   gint             column);
182 gint              atk_table_get_row_at_index     (AtkTable         *table,
183                                                   gint             index);
184 gint              atk_table_get_column_at_index  (AtkTable         *table,
185                                                   gint             index);
186 AtkObject*        atk_table_get_caption          (AtkTable         *table);
187 gint              atk_table_get_n_columns        (AtkTable         *table);
188 AtkObject*        atk_table_get_column_description (AtkTable         *table,
189                                                     gint             column);
190 gint              atk_table_get_column_extent_at (AtkTable         *table,
191                                                   gint             row,
192                                                   gint             column);
193 AtkTable*         atk_table_get_column_header    (AtkTable         *table);
194 gint              atk_table_get_n_rows           (AtkTable         *table);
195 AtkObject*        atk_table_get_row_description  (AtkTable         *table,
196                                                   gint             r);
197 gint              atk_table_get_row_extent_at    (AtkTable         *table,
198                                                   gint             row,
199                                                   gint             column);
200 AtkTable*         atk_table_get_row_header       (AtkTable         *table);
201 AtkObject*        atk_table_get_summary          (AtkTable         *table);
202 gint*             atk_table_get_selected_columns (AtkTable         *table);
203 gint*             atk_table_get_selected_rows    (AtkTable         *table);
204 gboolean          atk_table_is_column_selected   (AtkTable         *table,
205                                                   gint             column);
206 gboolean          atk_table_is_row_selected      (AtkTable         *table,
207                                                   gint             row);
208 gboolean          atk_table_is_selected          (AtkTable         *table,
209                                                   gint             row,
210                                                   gint             column);
211 void              atk_table_set_caption          (AtkTable         *table,
212                                                   AtkObject        *accessible);
213 void              atk_table_set_column_description (AtkTable       *table,
214                                                     gint           column,
215                                                     AtkObject      *accessible);
216 void              atk_table_set_column_header    (AtkTable         *table,
217                                                   gint             column,
218                                                   AtkTable         *header);
219 void              atk_table_set_row_description  (AtkTable         *table,
220                                                   gint             row,
221                                                   AtkObject        *accessible);
222 void              atk_table_set_row_header       (AtkTable         *table,
223                                                   gint             row,
224                                                   AtkTable         *header);
225 void              atk_table_set_summary          (AtkTable         *table,
226                                                   AtkObject        *accessible);
227
228 #ifdef __cplusplus
229 }
230 #endif /* __cplusplus */
231
232
233 #endif /* __ATK_TABLE_H__ */