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