1 /* ATK - Accessibility Toolkit
2 * Copyright 2001 Sun Microsystems Inc.
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.
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.
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.
21 #include "atkmarshal.h"
28 struct _AtkTableIfaceClass
33 typedef struct _AtkTableIfaceClass AtkTableIfaceClass;
35 static void atk_table_base_init (gpointer *g_class);
37 static guint atk_table_signals[LAST_SIGNAL] = { 0 };
42 static GType type = 0;
47 sizeof (AtkTableIface),
48 (GBaseInitFunc) atk_table_base_init,
49 (GBaseFinalizeFunc) NULL,
53 type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
61 atk_table_base_init (gpointer *g_class)
63 static gboolean initialized = FALSE;
67 atk_table_signals[MODEL_CHANGED] =
68 g_signal_newc ("model_changed",
71 G_STRUCT_OFFSET (AtkTableIface, model_changed),
72 (GSignalAccumulator) NULL, NULL,
73 atk_marshal_VOID__INT_INT_INT_INT_INT,
75 5, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT, G_TYPE_INT,
83 * @table: a GObject instance that implements AtkTableIface
84 * @row: a #gint representing a row in @table
85 * @column: a #gint representing a column in @table
87 * Get a reference to the table cell at @row, @column
89 * Returns: a AtkObject* representing the referred to accessible
92 atk_table_ref_at (AtkTable *obj,
98 g_return_val_if_fail (obj != NULL, NULL);
99 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
101 iface = ATK_TABLE_GET_IFACE (obj);
104 return (iface->ref_at) (obj, row, column);
110 * atk_table_get_index_at:
111 * @table: a GObject instance that implements AtkTableIface
112 * @row: a #gint representing a row in @table
113 * @column: a #gint representing a column in @table
115 * Gets a #gint representing the index at the specified @row and @column,
116 * or 0 if value does not implement this interface.
117 * Note: callers should not rely on %NULL or on a zero value for
118 * indication of whether AtkSelectionIface is implemented, they should
119 * use type checking/interface checking macros or the
120 * atk_get_accessible_table() convenience method.
122 * Returns: a #gint representing the index at specified position, or 0
123 * if value does not implement this interface.
126 atk_table_get_index_at (AtkTable *obj,
130 AtkTableIface *iface;
132 g_return_val_if_fail (obj != NULL, 0);
133 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
135 iface = ATK_TABLE_GET_IFACE (obj);
137 if (iface->get_index_at)
138 return (iface->get_index_at) (obj, row, column);
144 * atk_table_get_row_at_index:
145 * @table: a GObject instance that implements AtkTableInterface
146 * @index: a #gint representing an index in @table
148 * Gets a #gint representing the row at the specified @index, or 0
149 * if the value does not implement this interface
150 * Note: callers should not rely on %NULL or on a zero value for
151 * indication of whether AtkSelectionIface is implemented, they should
152 * use type checking/interface checking macros or the
153 * atk_get_accessible_table() convenience method.
155 * Returns: a gint representing the row at the specified index, or 0
156 * if value does not implement this interface.
159 atk_table_get_row_at_index (AtkTable *obj,
162 AtkTableIface *iface;
164 g_return_val_if_fail (obj != NULL, 0);
165 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
167 iface = ATK_TABLE_GET_IFACE (obj);
169 if (iface->get_row_at_index)
170 return (iface->get_row_at_index) (obj, index);
176 * atk_table_get_column_at_index:
177 * @table: a GObject instance that implements AtkTableInterface
178 * @index: a #gint representing an index in @table
180 * Gets a #gint representing the column at the specified @index, or 0
181 * if the value does not implement this interface
182 * Note: callers should not rely on %NULL or on a zero value for
183 * indication of whether AtkSelectionIface is implemented, they should
184 * use type checking/interface checking macros or the
185 * atk_get_accessible_table() convenience method.
187 * Returns: a gint representing the column at the specified index, or 0
188 * if value does not implement this interface.
191 atk_table_get_column_at_index (AtkTable *obj,
194 AtkTableIface *iface;
196 g_return_val_if_fail (obj != NULL, 0);
197 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
199 iface = ATK_TABLE_GET_IFACE (obj);
201 if (iface->get_column_at_index)
202 return (iface->get_column_at_index) (obj, index);
208 * atk_table_get_caption:
209 * @table: a GObject instance that implements AtkTableInterface
211 * Gets the caption for the @table.
212 * Note: callers should not rely on %NULL or on a zero value for
213 * indication of whether AtkSelectionIface is implemented, they should
214 * use type checking/interface checking macros or the
215 * atk_get_accessible_table() convenience method.
217 * Returns: a gchar* representing the table caption, or %NULL
218 * if value does not implement this interface.
221 atk_table_get_caption (AtkTable *obj)
223 AtkTableIface *iface;
225 g_return_val_if_fail (obj != NULL, NULL);
226 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
228 iface = ATK_TABLE_GET_IFACE (obj);
230 if (iface->get_caption)
231 return (iface->get_caption) (obj);
237 * atk_table_get_n_columns:
238 * @table: a GObject instance that implements AtkTableIface
240 * Gets the number of columns in the table.
241 * Note: callers should not rely on %NULL or on a zero value for
242 * indication of whether AtkSelectionIface is implemented, they should
243 * use type checking/interface checking macros or the
244 * atk_get_accessible_table() convenience method.
246 * Returns: a gint representing the number of columns, or 0
247 * if value does not implement this interface.
250 atk_table_get_n_columns (AtkTable *obj)
252 AtkTableIface *iface;
254 g_return_val_if_fail (obj != NULL, 0);
255 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
257 iface = ATK_TABLE_GET_IFACE (obj);
259 if (iface->get_n_columns)
260 return (iface->get_n_columns) (obj);
266 * atk_table_get_column_description:
267 * @table: a GObject instance that implements AtkTableIface
268 * @column: a #gint representing a column in @table
270 * Gets the description text of the specified @column in the table
271 * Note: callers should not rely on %NULL or on a zero value for
272 * indication of whether AtkSelectionIface is implemented, they should
273 * use type checking/interface checking macros or the
274 * atk_get_accessible_table() convenience method.
276 * Returns: a gchar* representing the column description, or %NULL
277 * if value does not implement this interface.
280 atk_table_get_column_description (AtkTable *obj,
283 AtkTableIface *iface;
285 g_return_val_if_fail (obj != NULL, NULL);
286 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
288 iface = ATK_TABLE_GET_IFACE (obj);
290 if (iface->get_column_description)
291 return (iface->get_column_description) (obj, column);
297 * atk_table_get_column_extent_at:
298 * @table: a GObject instance that implements AtkTableIface
299 * @row: a #gint representing a row in @table
300 * @column: a #gint representing a column in @table
302 * Gets the number of columns occupied by the accessible object
303 * at the specified @row and @column in the @table.
304 * Note: callers should not rely on %NULL or on a zero value for
305 * indication of whether AtkSelectionIface is implemented, they should
306 * use type checking/interface checking macros or the
307 * atk_get_accessible_table() convenience method.
309 * Returns: a gint representing the column extent at specified position, or 0
310 * if value does not implement this interface.
313 atk_table_get_column_extent_at (AtkTable *obj,
317 AtkTableIface *iface;
319 g_return_val_if_fail (obj != NULL, 0);
320 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
322 iface = ATK_TABLE_GET_IFACE (obj);
324 if (iface->get_column_extent_at)
325 return (iface->get_column_extent_at) (obj, row, column);
331 * atk_table_get_column_header:
332 * @table: a GObject instance that implements AtkTableIface
333 * @column: a #gint representing a column in the table
335 * Gets the column header of a specified column in an accessible table.
336 * Note: callers should not rely on %NULL or on a zero value for
337 * indication of whether AtkSelectionIface is implemented, they should
338 * use type checking/interface checking macros or the
339 * atk_get_accessible_table() convenience method.
341 * Returns: a AtkObject* representing the specified column header, or
342 * %NULL if value does not implement this interface.
345 atk_table_get_column_header (AtkTable *obj, gint column)
347 AtkTableIface *iface;
349 g_return_val_if_fail (obj != NULL, NULL);
350 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
352 iface = ATK_TABLE_GET_IFACE (obj);
354 if (iface->get_column_header)
355 return (iface->get_column_header) (obj, column);
361 * atk_table_get_n_rows:
362 * @table: a GObject instance that implements AtkTableIface
364 * Gets the number of rows in the table.
365 * Note: callers should not rely on %NULL or on a zero value for
366 * indication of whether AtkSelectionIface is implemented, they should
367 * use type checking/interface checking macros or the
368 * atk_get_accessible_table() convenience method.
370 * Returns: a gint representing the number of rows, or 0
371 * if value does not implement this interface.
374 atk_table_get_n_rows (AtkTable *obj)
376 AtkTableIface *iface;
378 g_return_val_if_fail (obj != NULL, 0);
379 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
381 iface = ATK_TABLE_GET_IFACE (obj);
383 if (iface->get_n_rows)
384 return (iface->get_n_rows) (obj);
390 * atk_table_get_row_description:
391 * @table: a GObject instance that implements AtkTableIface
392 * @r: a #gint representing a row in @table
394 * Gets the description text of the specified row in the table
395 * Note: callers should not rely on %NULL or on a zero value for
396 * indication of whether AtkSelectionIface is implemented, they should
397 * use type checking/interface checking macros or the
398 * atk_get_accessible_table() convenience method.
400 * Returns: a gchar* representing the row description, or %NULL
401 * if value does not implement this interface.
404 atk_table_get_row_description (AtkTable *obj,
407 AtkTableIface *iface;
409 g_return_val_if_fail (obj != NULL, NULL);
410 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
412 iface = ATK_TABLE_GET_IFACE (obj);
414 if (iface->get_row_description)
415 return (iface->get_row_description) (obj, row);
421 * atk_table_get_row_extent_at:
422 * @table: a GObject instance that implements AtkTableIface
423 * @row: a #gint representing a row in @table
424 * @column: a #gint representing a column in @table
426 * Gets the number of rows occupied by the accessible object
427 * at a specified @row and @column in the @table.
428 * Note: callers should not rely on %NULL or on a zero value for
429 * indication of whether AtkSelectionIface is implemented, they should
430 * use type checking/interface checking macros or the
431 * atk_get_accessible_table() convenience method.
433 * Returns: a gint representing the row extent at specified position, or 0
434 * if value does not implement this interface.
437 atk_table_get_row_extent_at (AtkTable *obj,
441 AtkTableIface *iface;
443 g_return_val_if_fail (obj != NULL, 0);
444 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
446 iface = ATK_TABLE_GET_IFACE (obj);
448 if (iface->get_row_extent_at)
449 return (iface->get_row_extent_at) (obj, row, column);
455 * atk_table_get_row_header:
456 * @table: a GObject instance that implements AtkTableIface
457 * @row: a #gint representing a row in the table
459 * Gets the row header of a specified row in an accessible table.
460 * Note: callers should not rely on %NULL or on a zero value for
461 * indication of whether AtkSelectionIface is implemented, they should
462 * use type checking/interface checking macros or the
463 * atk_get_accessible_table() convenience method.
465 * Returns: a AtkObject* representing the specified row header, or
466 * %NULL if value does not implement this interface.
469 atk_table_get_row_header (AtkTable *obj, gint row)
471 AtkTableIface *iface;
473 g_return_val_if_fail (obj != NULL, NULL);
474 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
476 iface = ATK_TABLE_GET_IFACE (obj);
478 if (iface->get_row_header)
479 return (iface->get_row_header) (obj, row);
485 * atk_table_get_summary:
486 * @table: a GObject instance that implements AtkTableIface
488 * Gets the summary description of the table.
489 * Note: callers should not rely on %NULL or on a zero value for
490 * indication of whether AtkSelectionIface is implemented, they should
491 * use type checking/interface checking macros or the
492 * atk_get_accessible_table() convenience method.
494 * Returns: a AtkObject* representing a sumary description of the table,
495 * or %NULL if value does not implement this interface.
498 atk_table_get_summary (AtkTable *obj)
500 AtkTableIface *iface;
502 g_return_val_if_fail (obj != NULL, NULL);
503 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
505 iface = ATK_TABLE_GET_IFACE (obj);
507 if (iface->get_summary)
508 return (iface->get_summary) (obj);
514 * atk_table_get_selected_rows:
515 * @table: a GObject instance that implements AtkTableIface
517 * Gets the selected rows of the table.
518 * Note: callers should not rely on %NULL or on a zero value for
519 * indication of whether AtkSelectionIface is implemented, they should
520 * use type checking/interface checking macros or the
521 * atk_get_accessible_table() convenience method.
523 * Returns: a gint* representing the selected rows,
524 * or %NULL if value does not implement this interface.
527 atk_table_get_selected_rows (AtkTable *obj)
529 AtkTableIface *iface;
531 g_return_val_if_fail (obj != NULL, NULL);
532 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
534 iface = ATK_TABLE_GET_IFACE (obj);
536 if (iface->get_selected_rows)
537 return (iface->get_selected_rows) (obj);
543 * atk_table_get_selected_columns:
544 * @table: a GObject instance that implements AtkTableIface
546 * Gets the selected columns of the table.
547 * Note: callers should not rely on %NULL or on a zero value for
548 * indication of whether AtkSelectionIface is implemented, they should
549 * use type checking/interface checking macros or the
550 * atk_get_accessible_table() convenience method.
552 * Returns: a gint* representing the selected columns,
553 * or %NULL if value does not implement this interface.
557 atk_table_get_selected_columns (AtkTable *obj)
559 AtkTableIface *iface;
561 g_return_val_if_fail (obj != NULL, NULL);
562 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
564 iface = ATK_TABLE_GET_IFACE (obj);
566 if (iface->get_selected_columns)
567 return (iface->get_selected_columns) (obj);
573 * atk_table_is_column_selected:
574 * @table: a GObject instance that implements AtkTableIface
575 * @column: a #gint representing a column in @table
577 * Gets a boolean value indicating whether the specified @column
579 * Note: callers should not rely on %NULL or on a zero value for
580 * indication of whether AtkSelectionIface is implemented, they should
581 * use type checking/interface checking macros or the
582 * atk_get_accessible_table() convenience method.
584 * Returns: a gboolean representing if the column is selected, or 0
585 * if value does not implement this interface.
588 atk_table_is_column_selected (AtkTable *obj,
591 AtkTableIface *iface;
593 g_return_val_if_fail (obj != NULL, FALSE);
594 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
596 iface = ATK_TABLE_GET_IFACE (obj);
598 if (iface->is_column_selected)
599 return (iface->is_column_selected) (obj, column);
605 * atk_table_is_row_selected:
606 * @table: a GObject instance that implements AtkTableIface
607 * @row: a #gint representing a row in @table
609 * Gets a boolean value indicating whether the specified @row
611 * Note: callers should not rely on %NULL or on a zero value for
612 * indication of whether AtkSelectionIface is implemented, they should
613 * use type checking/interface checking macros or the
614 * atk_get_accessible_table() convenience method.
616 * Returns: a gboolean representing if the row is selected, or 0
617 * if value does not implement this interface.
620 atk_table_is_row_selected (AtkTable *obj,
623 AtkTableIface *iface;
625 g_return_val_if_fail (obj != NULL, FALSE);
626 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
628 iface = ATK_TABLE_GET_IFACE (obj);
630 if (iface->is_row_selected)
631 return (iface->is_row_selected) (obj, row);
637 * atk_table_is_selected:
638 * @table: a GObject instance that implements AtkTableIface
639 * @row: a #gint representing a row in @table
640 * @column: a #gint representing a column in @table
642 * Gets a boolean value indicating whether the acessible object
643 * at the specified @row and @column is selected
644 * Note: callers should not rely on %NULL or on a zero value for
645 * indication of whether AtkSelectionIface is implemented, they should
646 * use type checking/interface checking macros or the
647 * atk_get_accessible_table() convenience method.
649 * Returns: a gboolean representing if the cell is selected, or 0
650 * if value does not implement this interface.
653 atk_table_is_selected (AtkTable *obj,
657 AtkTableIface *iface;
659 g_return_val_if_fail (obj != NULL, FALSE);
660 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
662 iface = ATK_TABLE_GET_IFACE (obj);
664 if (iface->is_selected)
665 return (iface->is_selected) (obj, row, column);
671 * atk_table_set_caption:
672 * @table: a GObject instance that implements AtkTableIface
673 * @caption: a #gchar representing the caption to set for @table
675 * Sets the caption for the table.
678 atk_table_set_caption (AtkTable *obj,
681 AtkTableIface *iface;
683 g_return_if_fail (obj != NULL);
684 g_return_if_fail (ATK_IS_TABLE (obj));
686 iface = ATK_TABLE_GET_IFACE (obj);
688 if (iface->set_caption)
689 (iface->set_caption) (obj, caption);
693 * atk_table_set_column_description:
694 * @table: a GObject instance that implements AtkTableIface
695 * @column: a #gint representing a column in @table
696 * @description: a #gchar representing the description text
697 * to set for the specified @column of the @table
699 * Sets the description text for the specified @column of the @table.
702 atk_table_set_column_description (AtkTable *obj,
706 AtkTableIface *iface;
708 g_return_if_fail (obj != NULL);
709 g_return_if_fail (ATK_IS_TABLE (obj));
711 iface = ATK_TABLE_GET_IFACE (obj);
713 if (iface->set_column_description)
714 (iface->set_column_description) (obj, column, description);
718 * atk_table_set_column_header:
719 * @table: a GObject instance that implements AtkTableIface
720 * @column: a #gint representing a column in @table
721 * @header: an #AtkTable
723 * Sets the specified column header to @header
726 atk_table_set_column_header (AtkTable *obj,
730 AtkTableIface *iface;
732 g_return_if_fail (obj != NULL);
733 g_return_if_fail (ATK_IS_TABLE (obj));
735 iface = ATK_TABLE_GET_IFACE (obj);
737 if (iface->set_column_header)
738 (iface->set_column_header) (obj, column, header);
742 * atk_table_set_row_description:
743 * @table: a GObject instance that implements AtkTableIface
744 * @row: a #gint representing a row in @table
745 * @description: a #gchar representing the description text
746 * to set for the specified @row of @table
748 * Sets the description text for the specified @row of @table.
751 atk_table_set_row_description (AtkTable *obj,
755 AtkTableIface *iface;
757 g_return_if_fail (obj != NULL);
758 g_return_if_fail (ATK_IS_TABLE (obj));
760 iface = ATK_TABLE_GET_IFACE (obj);
762 if (iface->set_row_description)
763 (iface->set_row_description) (obj, row, description);
767 * atk_table_set_row_header:
768 * @table: a GObject instance that implements AtkTableIface
769 * @row: a #gint representing a row in @table
770 * @header: an #AtkTable
772 * Sets the specified row header to @header
775 atk_table_set_row_header (AtkTable *obj,
779 AtkTableIface *iface;
781 g_return_if_fail (obj != NULL);
782 g_return_if_fail (ATK_IS_TABLE (obj));
784 iface = ATK_TABLE_GET_IFACE (obj);
786 if (iface->set_row_header)
787 (iface->set_row_header) (obj, row, header);
791 * atk_table_set_summary:
792 * @table: a GObject instance that implements AtkTableIface
793 * @accessible: an #AtkObject representing the summary description
796 * Sets the summary description of the table
799 atk_table_set_summary (AtkTable *obj,
800 AtkObject *accessible)
802 AtkTableIface *iface;
804 g_return_if_fail (obj != NULL);
805 g_return_if_fail (ATK_IS_TABLE (obj));
807 iface = ATK_TABLE_GET_IFACE (obj);
809 if (iface->set_summary)
810 (iface->set_summary) (obj, accessible);