d28591d6d8b6bdfee3099888a3502c3f3b942c80
[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: (transfer none): a AtkObject* representing the table caption, or
361  * %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: (transfer none): a AtkObject* representing the specified column
465  * header, or %NULL if value does not implement this interface.
466  **/
467 AtkObject*
468 atk_table_get_column_header (AtkTable *table, gint column)
469 {
470   AtkTableIface *iface;
471
472   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
473
474   iface = ATK_TABLE_GET_IFACE (table);
475
476   if (iface->get_column_header)
477     return (iface->get_column_header) (table, column);
478   else
479     return NULL;
480 }
481
482 /**
483  * atk_table_get_n_rows:
484  * @table: a GObject instance that implements AtkTableIface
485  *
486  * Gets the number of rows in the table.
487  *
488  * Returns: a gint representing the number of rows, or 0
489  * if value does not implement this interface.
490  **/
491 gint
492 atk_table_get_n_rows (AtkTable *table)
493 {
494   AtkTableIface *iface;
495
496   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
497
498   iface = ATK_TABLE_GET_IFACE (table);
499
500   if (iface->get_n_rows)
501     return (iface->get_n_rows) (table);
502   else
503     return 0;
504 }
505
506 /**
507  * atk_table_get_row_description:
508  * @table: a GObject instance that implements AtkTableIface
509  * @row: a #gint representing a row in @table
510  *
511  * Gets the description text of the specified row in the table
512  *
513  * Returns: a gchar* representing the row description, or %NULL
514  * if value does not implement this interface.
515  **/
516 const gchar*
517 atk_table_get_row_description (AtkTable *table,
518                                gint      row)
519 {
520   AtkTableIface *iface;
521
522   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
523
524   iface = ATK_TABLE_GET_IFACE (table);
525
526   if (iface->get_row_description)
527     return (iface->get_row_description) (table, row);
528   else
529     return NULL;
530 }
531
532 /**
533  * atk_table_get_row_extent_at:
534  * @table: a GObject instance that implements AtkTableIface
535  * @row: a #gint representing a row in @table
536  * @column: a #gint representing a column in @table
537  *
538  * Gets the number of rows occupied by the accessible object
539  * at a specified @row and @column in the @table.
540  *
541  * Returns: a gint representing the row extent at specified position, or 0
542  * if value does not implement this interface.
543  **/
544 gint
545 atk_table_get_row_extent_at (AtkTable *table,
546                              gint     row,
547                              gint     column)
548 {
549   AtkTableIface *iface;
550
551   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
552
553   iface = ATK_TABLE_GET_IFACE (table);
554
555   if (iface->get_row_extent_at)
556     return (iface->get_row_extent_at) (table, row, column);
557   else
558     return 0;
559 }
560
561 /**
562  * atk_table_get_row_header:
563  * @table: a GObject instance that implements AtkTableIface
564  * @row: a #gint representing a row in the table
565  *
566  * Gets the row header of a specified row in an accessible table.
567  *
568  * Returns: (transfer none): a AtkObject* representing the specified row
569  * header, or %NULL if value does not implement this interface.
570  **/
571 AtkObject*
572 atk_table_get_row_header (AtkTable *table, gint row)
573 {
574   AtkTableIface *iface;
575
576   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
577
578   iface = ATK_TABLE_GET_IFACE (table);
579
580   if (iface->get_row_header)
581     return (iface->get_row_header) (table, row);
582   else
583     return NULL;
584 }
585
586 /**
587  * atk_table_get_summary:
588  * @table: a GObject instance that implements AtkTableIface
589  *
590  * Gets the summary description of the table.
591  *
592  * Returns: (transfer full): a AtkObject* representing a summary description
593  * of the table, or zero if value does not implement this interface.
594  **/
595 AtkObject*
596 atk_table_get_summary (AtkTable *table)
597 {
598   AtkTableIface *iface;
599
600   g_return_val_if_fail (ATK_IS_TABLE (table), NULL);
601
602   iface = ATK_TABLE_GET_IFACE (table);
603
604   if (iface->get_summary)
605     return (iface->get_summary) (table);
606   else
607     return NULL;
608 }
609
610 /**
611  * atk_table_get_selected_rows:
612  * @table: a GObject instance that implements AtkTableIface
613  * @selected: a #gint** that is to contain the selected row numbers
614  *
615  * Gets the selected rows of the table by initializing **selected with 
616  * the selected row numbers. This array should be freed by the caller.
617  *
618  * Returns: a gint representing the number of selected rows,
619  * or zero if value does not implement this interface.
620  **/
621 gint
622 atk_table_get_selected_rows (AtkTable *table, gint **selected)
623 {
624   AtkTableIface *iface;
625
626   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
627
628   iface = ATK_TABLE_GET_IFACE (table);
629
630   if (iface->get_selected_rows)
631     return (iface->get_selected_rows) (table, selected);
632   else
633     return 0;
634 }
635
636 /**
637  * atk_table_get_selected_columns:
638  * @table: a GObject instance that implements AtkTableIface
639  * @selected: a #gint** that is to contain the selected columns numbers
640  *
641  * Gets the selected columns of the table by initializing **selected with 
642  * the selected column numbers. This array should be freed by the caller.
643  *
644  * Returns: a gint representing the number of selected columns,
645  * or %0 if value does not implement this interface.
646  **/
647 gint 
648 atk_table_get_selected_columns (AtkTable *table, gint **selected)
649 {
650   AtkTableIface *iface;
651
652   g_return_val_if_fail (ATK_IS_TABLE (table), 0);
653
654   iface = ATK_TABLE_GET_IFACE (table);
655
656   if (iface->get_selected_columns)
657     return (iface->get_selected_columns) (table, selected);
658   else
659     return 0;
660 }
661
662 /**
663  * atk_table_is_column_selected:
664  * @table: a GObject instance that implements AtkTableIface
665  * @column: a #gint representing a column in @table
666  *
667  * Gets a boolean value indicating whether the specified @column
668  * is selected
669  *
670  * Returns: a gboolean representing if the column is selected, or 0
671  * if value does not implement this interface.
672  **/
673 gboolean
674 atk_table_is_column_selected (AtkTable *table,
675                               gint     column)
676 {
677   AtkTableIface *iface;
678
679   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
680
681   iface = ATK_TABLE_GET_IFACE (table);
682
683   if (iface->is_column_selected)
684     return (iface->is_column_selected) (table, column);
685   else
686     return FALSE;
687 }
688
689 /**
690  * atk_table_is_row_selected:
691  * @table: a GObject instance that implements AtkTableIface
692  * @row: a #gint representing a row in @table
693  *
694  * Gets a boolean value indicating whether the specified @row
695  * is selected
696  *
697  * Returns: a gboolean representing if the row is selected, or 0
698  * if value does not implement this interface.
699  **/
700 gboolean
701 atk_table_is_row_selected (AtkTable *table,
702                            gint     row)
703 {
704   AtkTableIface *iface;
705
706   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
707
708   iface = ATK_TABLE_GET_IFACE (table);
709
710   if (iface->is_row_selected)
711     return (iface->is_row_selected) (table, row);
712   else
713     return FALSE;
714 }
715
716 /**
717  * atk_table_is_selected:
718  * @table: a GObject instance that implements AtkTableIface
719  * @row: a #gint representing a row in @table
720  * @column: a #gint representing a column in @table
721  *
722  * Gets a boolean value indicating whether the accessible object
723  * at the specified @row and @column is selected
724  *
725  * Returns: a gboolean representing if the cell is selected, or 0
726  * if value does not implement this interface.
727  **/
728 gboolean
729 atk_table_is_selected (AtkTable *table,
730                        gint     row,
731                        gint     column)
732 {
733   AtkTableIface *iface;
734
735   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
736
737   iface = ATK_TABLE_GET_IFACE (table);
738
739   if (iface->is_selected)
740     return (iface->is_selected) (table, row, column);
741   else
742     return FALSE;
743 }
744
745 /**
746  * atk_table_add_row_selection:
747  * @table: a GObject instance that implements AtkTableIface
748  * @row: a #gint representing a row in @table
749  *
750  * Adds the specified @row to the selection. 
751  *
752  * Returns: a gboolean representing if row was successfully added to selection,
753  * or 0 if value does not implement this interface.
754  **/
755 gboolean
756 atk_table_add_row_selection (AtkTable *table,
757                                  gint     row)
758 {
759   AtkTableIface *iface;
760
761   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
762
763   iface = ATK_TABLE_GET_IFACE (table);
764
765   if (iface->add_row_selection)
766     return (iface->add_row_selection) (table, row);
767   else
768     return FALSE;
769 }
770 /**
771  * atk_table_remove_row_selection:
772  * @table: a GObject instance that implements AtkTableIface
773  * @row: a #gint representing a row in @table
774  *
775  * Removes the specified @row from the selection. 
776  *
777  * Returns: a gboolean representing if the row was successfully removed from
778  * the selection, or 0 if value does not implement this interface.
779  **/
780 gboolean
781 atk_table_remove_row_selection (AtkTable *table,
782                                     gint     row)
783 {
784   AtkTableIface *iface;
785
786   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
787
788   iface = ATK_TABLE_GET_IFACE (table);
789
790   if (iface->remove_row_selection)
791     return (iface->remove_row_selection) (table, row);
792   else
793     return FALSE;
794 }
795 /**
796  * atk_table_add_column_selection:
797  * @table: a GObject instance that implements AtkTableIface
798  * @column: a #gint representing a column in @table
799  *
800  * Adds the specified @column to the selection. 
801  *
802  * Returns: a gboolean representing if the column was successfully added to 
803  * the selection, or 0 if value does not implement this interface.
804  **/
805 gboolean
806 atk_table_add_column_selection (AtkTable *table,
807                                     gint     column)
808 {
809   AtkTableIface *iface;
810
811   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
812
813   iface = ATK_TABLE_GET_IFACE (table);
814
815   if (iface->add_column_selection)
816     return (iface->add_column_selection) (table, column);
817   else
818     return FALSE;
819 }
820 /**
821  * atk_table_remove_column_selection:
822  * @table: a GObject instance that implements AtkTableIface
823  * @column: a #gint representing a column in @table
824  *
825  * Adds the specified @column to the selection. 
826  *
827  * Returns: a gboolean representing if the column was successfully removed from
828  * the selection, or 0 if value does not implement this interface.
829  **/
830 gboolean
831 atk_table_remove_column_selection (AtkTable *table,
832                                            gint     column)
833 {
834   AtkTableIface *iface;
835
836   g_return_val_if_fail (ATK_IS_TABLE (table), FALSE);
837
838   iface = ATK_TABLE_GET_IFACE (table);
839
840   if (iface->remove_column_selection)
841     return (iface->remove_column_selection) (table, column);
842   else
843     return FALSE;
844 }
845
846 /**
847  * atk_table_set_caption:
848  * @table: a GObject instance that implements AtkTableIface
849  * @caption: a #AtkObject representing the caption to set for @table
850  *
851  * Sets the caption for the table.
852  **/
853 void
854 atk_table_set_caption (AtkTable       *table,
855                        AtkObject      *caption)
856 {
857   AtkTableIface *iface;
858
859   g_return_if_fail (ATK_IS_TABLE (table));
860
861   iface = ATK_TABLE_GET_IFACE (table);
862
863   if (iface->set_caption)
864     (iface->set_caption) (table, caption);
865 }
866
867 /**
868  * atk_table_set_column_description:
869  * @table: a GObject instance that implements AtkTableIface
870  * @column: a #gint representing a column in @table
871  * @description: a #gchar representing the description text
872  * to set for the specified @column of the @table
873  *
874  * Sets the description text for the specified @column of the @table.
875  **/
876 void
877 atk_table_set_column_description (AtkTable       *table,
878                                   gint           column,
879                                   const gchar    *description)
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_description)
888     (iface->set_column_description) (table, column, description);
889 }
890
891 /**
892  * atk_table_set_column_header:
893  * @table: a GObject instance that implements AtkTableIface
894  * @column: a #gint representing a column in @table
895  * @header: an #AtkTable
896  *
897  * Sets the specified column header to @header.
898  **/
899 void
900 atk_table_set_column_header (AtkTable  *table,
901                              gint      column,
902                              AtkObject *header)
903 {
904   AtkTableIface *iface;
905
906   g_return_if_fail (ATK_IS_TABLE (table));
907
908   iface = ATK_TABLE_GET_IFACE (table);
909
910   if (iface->set_column_header)
911     (iface->set_column_header) (table, column, header);
912 }
913
914 /**
915  * atk_table_set_row_description:
916  * @table: a GObject instance that implements AtkTableIface
917  * @row: a #gint representing a row in @table
918  * @description: a #gchar representing the description text
919  * to set for the specified @row of @table
920  *
921  * Sets the description text for the specified @row of @table.
922  **/
923 void
924 atk_table_set_row_description (AtkTable       *table,
925                                gint           row,
926                                const gchar    *description)
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_description)
935     (iface->set_row_description) (table, row, description);
936 }
937
938 /**
939  * atk_table_set_row_header:
940  * @table: a GObject instance that implements AtkTableIface
941  * @row: a #gint representing a row in @table
942  * @header: an #AtkTable 
943  *
944  * Sets the specified row header to @header.
945  **/
946 void
947 atk_table_set_row_header (AtkTable  *table,
948                           gint      row,
949                           AtkObject *header)
950 {
951   AtkTableIface *iface;
952
953   g_return_if_fail (ATK_IS_TABLE (table));
954
955   iface = ATK_TABLE_GET_IFACE (table);
956
957   if (iface->set_row_header)
958     (iface->set_row_header) (table, row, header);
959 }
960
961 /**
962  * atk_table_set_summary:
963  * @table: a GObject instance that implements AtkTableIface
964  * @accessible: an #AtkObject representing the summary description
965  * to set for @table
966  *
967  * Sets the summary description of the table.
968  **/
969 void
970 atk_table_set_summary (AtkTable       *table,
971                        AtkObject      *accessible)
972 {
973   AtkTableIface *iface;
974
975   g_return_if_fail (ATK_IS_TABLE (table));
976
977   iface = ATK_TABLE_GET_IFACE (table);
978
979   if (iface->set_summary)
980     (iface->set_summary) (table, accessible);
981 }