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