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