c536c27c4914805d80e391c6ad472182470deb66
[platform/upstream/atk.git] / atk / atktable.c
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 Lesser 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  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser 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 #include "atktable.h"
21 #include "atkmarshal.h"
22
23 enum {
24   ROW_INSERTED,
25   ROW_DELETED,
26   COLUMN_INSERTED,
27   COLUMN_DELETED,
28   ROW_REORDERED,
29   COLUMN_REORDERED,
30   LAST_SIGNAL
31 };
32
33 struct _AtkTableIfaceClass
34 {
35   GObjectClass parent;
36 };
37
38 typedef struct _AtkTableIfaceClass AtkTableIfaceClass;
39
40 static void atk_table_base_init (gpointer *g_class);
41
42 static guint atk_table_signals[LAST_SIGNAL] = { 0 };
43
44 GType
45 atk_table_get_type ()
46 {
47   static GType type = 0;
48
49   if (!type) {
50     GTypeInfo tinfo =
51     {
52       sizeof (AtkTableIface),
53       (GBaseInitFunc) atk_table_base_init,
54       (GBaseFinalizeFunc) NULL,
55
56     };
57
58     type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
59   }
60
61   return type;
62 }
63
64
65 static void
66 atk_table_base_init (gpointer *g_class)
67 {
68   static gboolean initialized = FALSE;
69
70   if (! initialized)
71   {
72     atk_table_signals[ROW_INSERTED] =
73       g_signal_newc ("row_inserted",
74                      ATK_TYPE_TABLE,
75                      G_SIGNAL_RUN_LAST,
76                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
77                      (GSignalAccumulator) NULL, NULL,
78                      atk_marshal_VOID__INT_INT,
79                      G_TYPE_NONE,
80                      2, G_TYPE_INT, G_TYPE_INT);
81     atk_table_signals[COLUMN_INSERTED] =
82       g_signal_newc ("column_inserted",
83                      ATK_TYPE_TABLE,
84                      G_SIGNAL_RUN_LAST,
85                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
86                      (GSignalAccumulator) NULL, NULL,
87                      atk_marshal_VOID__INT_INT,
88                      G_TYPE_NONE,
89                      2, G_TYPE_INT, G_TYPE_INT);
90     atk_table_signals[ROW_DELETED] =
91       g_signal_newc ("row_deleted",
92                      ATK_TYPE_TABLE,
93                      G_SIGNAL_RUN_LAST,
94                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
95                      (GSignalAccumulator) NULL, NULL,
96                      atk_marshal_VOID__INT_INT,
97                      G_TYPE_NONE,
98                      2, G_TYPE_INT, G_TYPE_INT);
99     atk_table_signals[COLUMN_DELETED] =
100       g_signal_newc ("column_deleted",
101                      ATK_TYPE_TABLE,
102                      G_SIGNAL_RUN_LAST,
103                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
104                      (GSignalAccumulator) NULL, NULL,
105                      atk_marshal_VOID__INT_INT,
106                      G_TYPE_NONE,
107                      2, G_TYPE_INT, G_TYPE_INT);
108     atk_table_signals[ROW_REORDERED] =
109       g_signal_newc ("row_reordered",
110                      ATK_TYPE_TABLE,
111                      G_SIGNAL_RUN_LAST,
112                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
113                      (GSignalAccumulator) NULL, NULL,
114                      g_cclosure_marshal_VOID__VOID,
115                      G_TYPE_NONE,
116                      0);
117     atk_table_signals[COLUMN_REORDERED] =
118       g_signal_newc ("column_reordered",
119                      ATK_TYPE_TABLE,
120                      G_SIGNAL_RUN_LAST,
121                      G_STRUCT_OFFSET (AtkTableIface, model_changed),
122                      (GSignalAccumulator) NULL, NULL,
123                      g_cclosure_marshal_VOID__VOID,
124                      G_TYPE_NONE,
125                      0);
126     initialized = TRUE;
127   }
128 }
129
130 /**
131  * atk_table_ref_at:
132  * @table: a GObject instance that implements AtkTableIface
133  * @row: a #gint representing a row in @table
134  * @column: a #gint representing a column in @table
135  *
136  * Get a reference to the table cell at @row, @column
137  *
138  * Returns: a AtkObject* representing the referred to accessible
139  **/
140 AtkObject*
141 atk_table_ref_at (AtkTable *table,
142                   gint     row,
143                   gint     column)
144 {
145   AtkTableIface *iface;
146
147   g_return_val_if_fail (table != NULL, NULL);
148   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
149
150   iface = ATK_TABLE_GET_IFACE (table);
151
152   if (iface->ref_at)
153     return (iface->ref_at) (table, row, column);
154   else
155     return NULL;
156 }
157
158 /**
159  * atk_table_get_index_at:
160  * @table: a GObject instance that implements AtkTableIface
161  * @row: a #gint representing a row in @table
162  * @column: a #gint representing a column in @table
163  *
164  * Gets a #gint representing the index at the specified @row and @column,
165  * or 0 if value does not implement this interface.
166  * Note: callers should not rely on %NULL or on a zero value for
167  * indication of whether AtkSelectionIface is implemented, they should
168  * use type checking/interface checking macros or the
169  * atk_get_accessible_table() convenience method.
170  *
171  * Returns: a #gint representing the index at specified position, or 0
172  * if value does not implement this interface.
173  **/
174 gint
175 atk_table_get_index_at (AtkTable *table,
176                         gint     row,
177                         gint     column)
178 {
179   AtkTableIface *iface;
180
181   g_return_val_if_fail (table != NULL, 0);
182   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
183
184   iface = ATK_TABLE_GET_IFACE (table);
185
186   if (iface->get_index_at)
187     return (iface->get_index_at) (table, row, column);
188   else
189     return 0;
190 }
191
192 /**
193  * atk_table_get_row_at_index:
194  * @table: a GObject instance that implements AtkTableInterface
195  * @index: a #gint representing an index in @table
196  *
197  * Gets a #gint representing the row at the specified @index, or 0
198  * if the value does not implement this interface
199  * Note: callers should not rely on %NULL or on a zero value for
200  * indication of whether AtkSelectionIface is implemented, they should
201  * use type checking/interface checking macros or the
202  * atk_get_accessible_table() convenience method.
203  *
204  * Returns: a gint representing the row at the specified  index, or 0
205  * if value does not implement this interface.
206  **/
207 gint
208 atk_table_get_row_at_index (AtkTable *table,
209                             gint     index)
210 {
211   AtkTableIface *iface;
212
213   g_return_val_if_fail (table != NULL, 0);
214   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
215
216   iface = ATK_TABLE_GET_IFACE (table);
217
218   if (iface->get_row_at_index)
219     return (iface->get_row_at_index) (table, index);
220   else
221     return 0;
222 }
223
224 /**
225  * atk_table_get_column_at_index:
226  * @table: a GObject instance that implements AtkTableInterface
227  * @index: a #gint representing an index in @table
228  *
229  * Gets a #gint representing the column at the specified @index, or 0
230  * if the value does not implement this interface
231  * Note: callers should not rely on %NULL or on a zero value for
232  * indication of whether AtkSelectionIface is implemented, they should
233  * use type checking/interface checking macros or the
234  * atk_get_accessible_table() convenience method.
235  *
236  * Returns: a gint representing the column at the specified  index, or 0
237  * if value does not implement this interface.
238  **/
239 gint
240 atk_table_get_column_at_index (AtkTable *table,
241                                gint     index)
242 {
243   AtkTableIface *iface;
244
245   g_return_val_if_fail (table != NULL, 0);
246   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
247
248   iface = ATK_TABLE_GET_IFACE (table);
249
250   if (iface->get_column_at_index)
251     return (iface->get_column_at_index) (table, index);
252   else
253     return 0;
254 }
255
256 /**
257  * atk_table_get_caption:
258  * @table: a GObject instance that implements AtkTableInterface
259  *
260  * Gets the caption for the @table.
261  * Note: callers should not rely on %NULL or on a zero value for
262  * indication of whether AtkSelectionIface is implemented, they should
263  * use type checking/interface checking macros or the
264  * atk_get_accessible_table() convenience method.
265  *
266  * Returns: a gchar* representing the table caption, or %NULL
267  * if value does not implement this interface.
268  **/
269 gchar*
270 atk_table_get_caption (AtkTable *table)
271 {
272   AtkTableIface *iface;
273
274   g_return_val_if_fail (table != NULL, NULL);
275   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
276
277   iface = ATK_TABLE_GET_IFACE (table);
278
279   if (iface->get_caption)
280     return (iface->get_caption) (table);
281   else
282     return NULL;
283 }
284
285 /**
286  * atk_table_get_n_columns:
287  * @table: a GObject instance that implements AtkTableIface
288  *
289  * Gets the number of columns in the table.
290  * Note: callers should not rely on %NULL or on a zero value for
291  * indication of whether AtkSelectionIface is implemented, they should
292  * use type checking/interface checking macros or the
293  * atk_get_accessible_table() convenience method.
294  *
295  * Returns: a gint representing the number of columns, or 0
296  * if value does not implement this interface.
297  **/
298 gint
299 atk_table_get_n_columns (AtkTable *table)
300 {
301   AtkTableIface *iface;
302
303   g_return_val_if_fail (table != NULL, 0);
304   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
305
306   iface = ATK_TABLE_GET_IFACE (table);
307
308   if (iface->get_n_columns)
309     return (iface->get_n_columns) (table);
310   else
311     return 0;
312 }
313
314 /**
315  * atk_table_get_column_description:
316  * @table: a GObject instance that implements AtkTableIface
317  * @column: a #gint representing a column in @table
318  *
319  * Gets the description text of the specified @column in the table
320  * Note: callers should not rely on %NULL or on a zero value for
321  * indication of whether AtkSelectionIface is implemented, they should
322  * use type checking/interface checking macros or the
323  * atk_get_accessible_table() convenience method.
324  *
325  * Returns: a gchar* representing the column description, or %NULL
326  * if value does not implement this interface.
327  **/
328 gchar*
329 atk_table_get_column_description (AtkTable *table,
330                                   gint     column)
331 {
332   AtkTableIface *iface;
333
334   g_return_val_if_fail (table != NULL, NULL);
335   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
336
337   iface = ATK_TABLE_GET_IFACE (table);
338
339   if (iface->get_column_description)
340     return (iface->get_column_description) (table, column);
341   else
342     return NULL;
343 }
344
345 /**
346  * atk_table_get_column_extent_at:
347  * @table: a GObject instance that implements AtkTableIface
348  * @row: a #gint representing a row in @table
349  * @column: a #gint representing a column in @table
350  *
351  * Gets the number of columns occupied by the accessible object
352  * at the specified @row and @column in the @table.
353  * Note: callers should not rely on %NULL or on a zero value for
354  * indication of whether AtkSelectionIface is implemented, they should
355  * use type checking/interface checking macros or the
356  * atk_get_accessible_table() convenience method.
357  *
358  * Returns: a gint representing the column extent at specified position, or 0
359  * if value does not implement this interface.
360  **/
361 gint
362 atk_table_get_column_extent_at (AtkTable *table,
363                                 gint     row,
364                                 gint     column)
365 {
366   AtkTableIface *iface;
367
368   g_return_val_if_fail (table != NULL, 0);
369   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
370
371   iface = ATK_TABLE_GET_IFACE (table);
372
373   if (iface->get_column_extent_at)
374     return (iface->get_column_extent_at) (table, row, column);
375   else
376     return 0;
377 }
378
379 /**
380  * atk_table_get_column_header:
381  * @table: a GObject instance that implements AtkTableIface
382  * @column: a #gint representing a column in the table
383  *
384  * Gets the column header of a specified column in an accessible table.
385  * Note: callers should not rely on %NULL or on a zero value for
386  * indication of whether AtkSelectionIface is implemented, they should
387  * use type checking/interface checking macros or the
388  * atk_get_accessible_table() convenience method.
389  *
390  * Returns: a AtkObject* representing the specified column header, or
391  * %NULL if value does not implement this interface.
392  **/
393 AtkObject*
394 atk_table_get_column_header (AtkTable *table, gint column)
395 {
396   AtkTableIface *iface;
397
398   g_return_val_if_fail (table != NULL, NULL);
399   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
400
401   iface = ATK_TABLE_GET_IFACE (table);
402
403   if (iface->get_column_header)
404     return (iface->get_column_header) (table, column);
405   else
406     return NULL;
407 }
408
409 /**
410  * atk_table_get_n_rows:
411  * @table: a GObject instance that implements AtkTableIface
412  *
413  * Gets the number of rows in the table.
414  * Note: callers should not rely on %NULL or on a zero value for
415  * indication of whether AtkSelectionIface is implemented, they should
416  * use type checking/interface checking macros or the
417  * atk_get_accessible_table() convenience method.
418  *
419  * Returns: a gint representing the number of rows, or 0
420  * if value does not implement this interface.
421  **/
422 gint
423 atk_table_get_n_rows (AtkTable *table)
424 {
425   AtkTableIface *iface;
426
427   g_return_val_if_fail (table != NULL, 0);
428   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
429
430   iface = ATK_TABLE_GET_IFACE (table);
431
432   if (iface->get_n_rows)
433     return (iface->get_n_rows) (table);
434   else
435     return 0;
436 }
437
438 /**
439  * atk_table_get_row_description:
440  * @table: a GObject instance that implements AtkTableIface
441  * @r: a #gint representing a row in @table
442  *
443  * Gets the description text of the specified row in the table
444  * Note: callers should not rely on %NULL or on a zero value for
445  * indication of whether AtkSelectionIface is implemented, they should
446  * use type checking/interface checking macros or the
447  * atk_get_accessible_table() convenience method.
448  *
449  * Returns: a gchar* representing the row description, or %NULL
450  * if value does not implement this interface.
451  **/
452 gchar*
453 atk_table_get_row_description (AtkTable *table,
454                                gint      row)
455 {
456   AtkTableIface *iface;
457
458   g_return_val_if_fail (table != NULL, NULL);
459   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
460
461   iface = ATK_TABLE_GET_IFACE (table);
462
463   if (iface->get_row_description)
464     return (iface->get_row_description) (table, row);
465   else
466     return NULL;
467 }
468
469 /**
470  * atk_table_get_row_extent_at:
471  * @table: a GObject instance that implements AtkTableIface
472  * @row: a #gint representing a row in @table
473  * @column: a #gint representing a column in @table
474  *
475  * Gets the number of rows occupied by the accessible object
476  * at a specified @row and @column in the @table.
477  * Note: callers should not rely on %NULL or on a zero value for
478  * indication of whether AtkSelectionIface is implemented, they should
479  * use type checking/interface checking macros or the
480  * atk_get_accessible_table() convenience method.
481  *
482  * Returns: a gint representing the row extent at specified position, or 0
483  * if value does not implement this interface.
484  **/
485 gint
486 atk_table_get_row_extent_at (AtkTable *table,
487                              gint     row,
488                              gint     column)
489 {
490   AtkTableIface *iface;
491
492   g_return_val_if_fail (table != NULL, 0);
493   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
494
495   iface = ATK_TABLE_GET_IFACE (table);
496
497   if (iface->get_row_extent_at)
498     return (iface->get_row_extent_at) (table, row, column);
499   else
500     return 0;
501 }
502
503 /**
504  * atk_table_get_row_header:
505  * @table: a GObject instance that implements AtkTableIface
506  * @row: a #gint representing a row in the table
507  *
508  * Gets the row header of a specified row in an accessible table.
509  * Note: callers should not rely on %NULL or on a zero value for
510  * indication of whether AtkSelectionIface is implemented, they should
511  * use type checking/interface checking macros or the
512  * atk_get_accessible_table() convenience method.
513  *
514  * Returns: a AtkObject* representing the specified row header, or
515  * %NULL if value does not implement this interface.
516  **/
517 AtkObject*
518 atk_table_get_row_header (AtkTable *table, gint row)
519 {
520   AtkTableIface *iface;
521
522   g_return_val_if_fail (table != NULL, NULL);
523   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
524
525   iface = ATK_TABLE_GET_IFACE (table);
526
527   if (iface->get_row_header)
528     return (iface->get_row_header) (table, row);
529   else
530     return NULL;
531 }
532
533 /**
534  * atk_table_get_summary:
535  * @table: a GObject instance that implements AtkTableIface
536  *
537  * Gets the summary description of the table.
538  * Note: callers should not rely on %NULL or on a zero value for
539  * indication of whether AtkSelectionIface is implemented, they should
540  * use type checking/interface checking macros or the
541  * atk_get_accessible_table() convenience method.
542  *
543  * Returns: a AtkObject* representing a sumary description of the table,
544  * or zero if value does not implement this interface.
545  **/
546 AtkObject*
547 atk_table_get_summary (AtkTable *table)
548 {
549   AtkTableIface *iface;
550
551   g_return_val_if_fail (table != NULL, NULL);
552   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
553
554   iface = ATK_TABLE_GET_IFACE (table);
555
556   if (iface->get_summary)
557     return (iface->get_summary) (table);
558   else
559     return NULL;
560 }
561
562 /**
563  * atk_table_get_selected_rows:
564  * @table: a GObject instance that implements AtkTableIface
565  * @selected: a #gint** that is to contain the selected row numbers
566  *
567  * Gets the selected rows of the table by initializing **selected with 
568  * the selected row numbers. This array should be freed by the caller.
569  * Note: callers should not rely on %NULL or on a zero value for
570  * indication of whether AtkSelectionIface is implemented, they should
571  * use type checking/interface checking macros or the
572  * atk_get_accessible_table() convenience method.
573  *
574  * Returns: a gint representing the number of selected rows,
575  * or zero if value does not implement this interface.
576  **/
577 gint
578 atk_table_get_selected_rows (AtkTable *table, gint **selected)
579 {
580   AtkTableIface *iface;
581
582   g_return_val_if_fail (table != NULL, 0);
583   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
584
585   iface = ATK_TABLE_GET_IFACE (table);
586
587   if (iface->get_selected_rows)
588     return (iface->get_selected_rows) (table, selected);
589   else
590     return 0;
591 }
592
593 /**
594  * atk_table_get_selected_columns:
595  * @table: a GObject instance that implements AtkTableIface
596  * @selected: a #gint** that is to contain the selected columns numbers
597  *
598  * Gets the selected columns of the table by initializing **selected with 
599  * the selected column numbers. This array should be freed by the caller.
600  * Note: callers should not rely on %NULL or on a zero value for
601  * indication of whether AtkSelectionIface is implemented, they should
602  * use type checking/interface checking macros or the
603  * atk_get_accessible_table() convenience method.
604  *
605  * Returns: a gint representing the number of selected columns,
606  * or %0 if value does not implement this interface.
607  *
608  **/
609 gint 
610 atk_table_get_selected_columns (AtkTable *table, gint **selected)
611 {
612   AtkTableIface *iface;
613
614   g_return_val_if_fail (table != NULL, 0);
615   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
616
617   iface = ATK_TABLE_GET_IFACE (table);
618
619   if (iface->get_selected_columns)
620     return (iface->get_selected_columns) (table, selected);
621   else
622     return 0;
623 }
624
625 /**
626  * atk_table_is_column_selected:
627  * @table: a GObject instance that implements AtkTableIface
628  * @column: a #gint representing a column in @table
629  *
630  * Gets a boolean value indicating whether the specified @column
631  * is selected
632  * Note: callers should not rely on %NULL or on a zero value for
633  * indication of whether AtkSelectionIface is implemented, they should
634  * use type checking/interface checking macros or the
635  * atk_get_accessible_table() convenience method.
636  *
637  * Returns: a gboolean representing if the column is selected, or 0
638  * if value does not implement this interface.
639  **/
640 gboolean
641 atk_table_is_column_selected (AtkTable *table,
642                               gint     column)
643 {
644   AtkTableIface *iface;
645
646   g_return_val_if_fail (table != NULL, FALSE);
647   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
648
649   iface = ATK_TABLE_GET_IFACE (table);
650
651   if (iface->is_column_selected)
652     return (iface->is_column_selected) (table, column);
653   else
654     return FALSE;
655 }
656
657 /**
658  * atk_table_is_row_selected:
659  * @table: a GObject instance that implements AtkTableIface
660  * @row: a #gint representing a row in @table
661  *
662  * Gets a boolean value indicating whether the specified @row
663  * is selected
664  * Note: callers should not rely on %NULL or on a zero value for
665  * indication of whether AtkSelectionIface is implemented, they should
666  * use type checking/interface checking macros or the
667  * atk_get_accessible_table() convenience method.
668  *
669  * Returns: a gboolean representing if the row is selected, or 0
670  * if value does not implement this interface.
671  **/
672 gboolean
673 atk_table_is_row_selected (AtkTable *table,
674                            gint     row)
675 {
676   AtkTableIface *iface;
677
678   g_return_val_if_fail (table != NULL, FALSE);
679   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
680
681   iface = ATK_TABLE_GET_IFACE (table);
682
683   if (iface->is_row_selected)
684     return (iface->is_row_selected) (table, row);
685   else
686     return FALSE;
687 }
688
689 /**
690  * atk_table_is_selected:
691  * @table: a GObject instance that implements AtkTableIface
692  * @row: a #gint representing a row in @table
693  * @column: a #gint representing a column in @table
694  *
695  * Gets a boolean value indicating whether the acessible object
696  * at the specified @row and @column is selected
697  * Note: callers should not rely on %NULL or on a zero value for
698  * indication of whether AtkSelectionIface is implemented, they should
699  * use type checking/interface checking macros or the
700  * atk_get_accessible_table() convenience method.
701  *
702  * Returns: a gboolean representing if the cell is selected, or 0
703  * if value does not implement this interface.
704  **/
705 gboolean
706 atk_table_is_selected (AtkTable *table,
707                        gint     row,
708                        gint     column)
709 {
710   AtkTableIface *iface;
711
712   g_return_val_if_fail (table != NULL, FALSE);
713   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
714
715   iface = ATK_TABLE_GET_IFACE (table);
716
717   if (iface->is_selected)
718     return (iface->is_selected) (table, row, column);
719   else
720     return FALSE;
721 }
722
723 /**
724  * atk_table_add_row_selection:
725  * @table: a GObject instance that implements AtkTableIface
726  * @row: a #gint representing a row in @table
727  *
728  * Adds the specified @row to the selection. 
729  * Note: callers should not rely on %NULL or on a zero value for
730  * indication of whether AtkSelectionIface is implemented, they should
731  * use type checking/interface checking macros or the
732  * atk_get_accessible_table() convenience method.
733  *
734  * Returns: a gboolean representing if row was successfully added to selection,
735  * or 0 if value does not implement this interface.
736  **/
737 gboolean
738 atk_table_add_row_selection (AtkTable *table,
739                                  gint     row)
740 {
741   AtkTableIface *iface;
742
743   g_return_val_if_fail (table != NULL, FALSE);
744   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
745
746   iface = ATK_TABLE_GET_IFACE (table);
747
748   if (iface->add_row_selection)
749     return (iface->add_row_selection) (table, row);
750   else
751     return FALSE;
752 }
753 /**
754  * atk_table_remove_row_selection:
755  * @table: a GObject instance that implements AtkTableIface
756  * @row: a #gint representing a row in @table
757  *
758  * Removes the specified @row from the selection. 
759  * Note: callers should not rely on %NULL or on a zero value for
760  * indication of whether AtkSelectionIface is implemented, they should
761  * use type checking/interface checking macros or the
762  * atk_get_accessible_table() convenience method.
763  *
764  * Returns: a gboolean representing if the row was successfully removed from
765  * the selection, or 0 if value does not implement this interface.
766  **/
767 gboolean
768 atk_table_remove_row_selection (AtkTable *table,
769                                     gint     row)
770 {
771   AtkTableIface *iface;
772
773   g_return_val_if_fail (table != NULL, FALSE);
774   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
775
776   iface = ATK_TABLE_GET_IFACE (table);
777
778   if (iface->remove_row_selection)
779     return (iface->remove_row_selection) (table, row);
780   else
781     return FALSE;
782 }
783 /**
784  * atk_table_add_column_selection:
785  * @table: a GObject instance that implements AtkTableIface
786  * @column: a #gint representing a column in @table
787  *
788  * Adds the specified @column to the selection. 
789  * Note: callers should not rely on %NULL or on a zero value for
790  * indication of whether AtkSelectionIface is implemented, they should
791  * use type checking/interface checking macros or the
792  * atk_get_accessible_table() convenience method.
793  *
794  * Returns: a gboolean representing if the column was successfully added to 
795  * the selection, or 0 if value does not implement this interface.
796  **/
797 gboolean
798 atk_table_add_column_selection (AtkTable *table,
799                                     gint     column)
800 {
801   AtkTableIface *iface;
802
803   g_return_val_if_fail (table != NULL, FALSE);
804   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
805
806   iface = ATK_TABLE_GET_IFACE (table);
807
808   if (iface->add_column_selection)
809     return (iface->add_column_selection) (table, column);
810   else
811     return FALSE;
812 }
813 /**
814  * atk_table_remove_column_selection:
815  * @table: a GObject instance that implements AtkTableIface
816  * @column: a #gint representing a column in @table
817  *
818  * Adds the specified @column to the selection. 
819  * Note: callers should not rely on %NULL or on a zero value for
820  * indication of whether AtkSelectionIface is implemented, they should
821  * use type checking/interface checking macros or the
822  * atk_get_accessible_table() convenience method.
823  *
824  * Returns: a gboolean representing if the column was successfully removed from
825  * the selection, or 0 if value does not implement this interface.
826  **/
827 gboolean
828 atk_table_remove_column_selection (AtkTable *table,
829                                            gint     column)
830 {
831   AtkTableIface *iface;
832
833   g_return_val_if_fail (table != NULL, FALSE);
834   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
835
836   iface = ATK_TABLE_GET_IFACE (table);
837
838   if (iface->remove_column_selection)
839     return (iface->remove_column_selection) (table, column);
840   else
841     return FALSE;
842 }
843
844 /**
845  * atk_table_set_caption:
846  * @table: a GObject instance that implements AtkTableIface
847  * @caption: a #gchar representing the caption to set for @table
848  *
849  * Sets the caption for the table.
850  **/
851 void
852 atk_table_set_caption (AtkTable       *table,
853                        gchar          *caption)
854 {
855   AtkTableIface *iface;
856
857   g_return_if_fail (table != NULL);
858   g_return_if_fail (ATK_IS_TABLE (table));
859
860   iface = ATK_TABLE_GET_IFACE (table);
861
862   if (iface->set_caption)
863     (iface->set_caption) (table, caption);
864 }
865
866 /**
867  * atk_table_set_column_description:
868  * @table: a GObject instance that implements AtkTableIface
869  * @column: a #gint representing a column in @table
870  * @description: a #gchar representing the description text
871  * to set for the specified @column of the @table
872  *
873  * Sets the description text for the specified @column of the @table.
874  **/
875 void
876 atk_table_set_column_description (AtkTable       *table,
877                                   gint           column,
878                                   gchar          *description)
879 {
880   AtkTableIface *iface;
881
882   g_return_if_fail (table != NULL);
883   g_return_if_fail (ATK_IS_TABLE (table));
884
885   iface = ATK_TABLE_GET_IFACE (table);
886
887   if (iface->set_column_description)
888     (iface->set_column_description) (table, column, description);
889 }
890
891 /**
892  * atk_table_set_column_header:
893  * @table: a GObject instance that implements AtkTableIface
894  * @column: a #gint representing a column in @table
895  * @header: an #AtkTable
896  *
897  * Sets the specified column header to @header
898  **/
899 void
900 atk_table_set_column_header (AtkTable  *table,
901                              gint      column,
902                              AtkObject *header)
903 {
904   AtkTableIface *iface;
905
906   g_return_if_fail (table != NULL);
907   g_return_if_fail (ATK_IS_TABLE (table));
908
909   iface = ATK_TABLE_GET_IFACE (table);
910
911   if (iface->set_column_header)
912     (iface->set_column_header) (table, column, header);
913 }
914
915 /**
916  * atk_table_set_row_description:
917  * @table: a GObject instance that implements AtkTableIface
918  * @row: a #gint representing a row in @table
919  * @description: a #gchar representing the description text
920  * to set for the specified @row of @table
921  *
922  * Sets the description text for the specified @row of @table.
923  **/
924 void
925 atk_table_set_row_description (AtkTable       *table,
926                                gint           row,
927                                gchar          *description)
928 {
929   AtkTableIface *iface;
930
931   g_return_if_fail (table != NULL);
932   g_return_if_fail (ATK_IS_TABLE (table));
933
934   iface = ATK_TABLE_GET_IFACE (table);
935
936   if (iface->set_row_description)
937     (iface->set_row_description) (table, row, description);
938 }
939
940 /**
941  * atk_table_set_row_header:
942  * @table: a GObject instance that implements AtkTableIface
943  * @row: a #gint representing a row in @table
944  * @header: an #AtkTable 
945  *
946  * Sets the specified row header to @header
947  **/
948 void
949 atk_table_set_row_header (AtkTable  *table,
950                           gint      row,
951                           AtkObject *header)
952 {
953   AtkTableIface *iface;
954
955   g_return_if_fail (table != NULL);
956   g_return_if_fail (ATK_IS_TABLE (table));
957
958   iface = ATK_TABLE_GET_IFACE (table);
959
960   if (iface->set_row_header)
961     (iface->set_row_header) (table, row, header);
962 }
963
964 /**
965  * atk_table_set_summary:
966  * @table: a GObject instance that implements AtkTableIface
967  * @accessible: an #AtkObject representing the summary description
968  * to set for @table
969  *
970  * Sets the summary description of the table
971  **/
972 void
973 atk_table_set_summary (AtkTable       *table,
974                        AtkObject      *accessible)
975 {
976   AtkTableIface *iface;
977
978   g_return_if_fail (table != NULL);
979   g_return_if_fail (ATK_IS_TABLE (table));
980
981   iface = ATK_TABLE_GET_IFACE (table);
982
983   if (iface->set_summary)
984     (iface->set_summary) (table, accessible);
985 }