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