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 AtkObject* 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 AtkObject* representing the table 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
334 * Gets the column headers of an accessible table.
335 * Note: callers should not rely on %NULL or on a zero value for
336 * indication of whether AtkSelectionIface is implemented, they should
337 * use type checking/interface checking macros or the
338 * atk_get_accessible_table() convenience method.
340 * Returns: a AtkObject* representing the column headers, or %NULL
341 * if value does not implement this interface.
344 atk_table_get_column_header (AtkTable *obj)
346 AtkTableIface *iface;
348 g_return_val_if_fail (obj != NULL, NULL);
349 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
351 iface = ATK_TABLE_GET_IFACE (obj);
353 if (iface->get_column_header)
354 return (iface->get_column_header) (obj);
360 * atk_table_get_n_rows:
361 * @table: a GObject instance that implements AtkTableIface
363 * Gets the number of rows in the table.
364 * Note: callers should not rely on %NULL or on a zero value for
365 * indication of whether AtkSelectionIface is implemented, they should
366 * use type checking/interface checking macros or the
367 * atk_get_accessible_table() convenience method.
369 * Returns: a gint representing the number of rows, or 0
370 * if value does not implement this interface.
373 atk_table_get_n_rows (AtkTable *obj)
375 AtkTableIface *iface;
377 g_return_val_if_fail (obj != NULL, 0);
378 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
380 iface = ATK_TABLE_GET_IFACE (obj);
382 if (iface->get_n_rows)
383 return (iface->get_n_rows) (obj);
389 * atk_table_get_row_description:
390 * @table: a GObject instance that implements AtkTableIface
391 * @r: a #gint representing a row in @table
393 * Gets the description text of the specified row in the table
394 * Note: callers should not rely on %NULL or on a zero value for
395 * indication of whether AtkSelectionIface is implemented, they should
396 * use type checking/interface checking macros or the
397 * atk_get_accessible_table() convenience method.
399 * Returns: a AtkObject* representing the table description, or %NULL
400 * if value does not implement this interface.
403 atk_table_get_row_description (AtkTable *obj,
406 AtkTableIface *iface;
408 g_return_val_if_fail (obj != NULL, NULL);
409 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
411 iface = ATK_TABLE_GET_IFACE (obj);
413 if (iface->get_row_description)
414 return (iface->get_row_description) (obj, row);
420 * atk_table_get_row_extent_at:
421 * @table: a GObject instance that implements AtkTableIface
422 * @row: a #gint representing a row in @table
423 * @column: a #gint representing a column in @table
425 * Gets the number of rows occupied by the accessible object
426 * at a specified @row and @column in the @table.
427 * Note: callers should not rely on %NULL or on a zero value for
428 * indication of whether AtkSelectionIface is implemented, they should
429 * use type checking/interface checking macros or the
430 * atk_get_accessible_table() convenience method.
432 * Returns: a gint representing the row extent at specified position, or 0
433 * if value does not implement this interface.
436 atk_table_get_row_extent_at (AtkTable *obj,
440 AtkTableIface *iface;
442 g_return_val_if_fail (obj != NULL, 0);
443 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
445 iface = ATK_TABLE_GET_IFACE (obj);
447 if (iface->get_row_extent_at)
448 return (iface->get_row_extent_at) (obj, row, column);
454 * atk_table_get_row_header:
455 * @table: a GObject instance that implements AtkTableIface
457 * Gets the row headers of an accessible table.
458 * Note: callers should not rely on %NULL or on a zero value for
459 * indication of whether AtkSelectionIface is implemented, they should
460 * use type checking/interface checking macros or the
461 * atk_get_accessible_table() convenience method.
463 * Returns: a AtkTable* representing the row headers, or %NULL
464 * if value does not implement this interface.
467 atk_table_get_row_header (AtkTable *obj)
469 AtkTableIface *iface;
471 g_return_val_if_fail (obj != NULL, NULL);
472 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
474 iface = ATK_TABLE_GET_IFACE (obj);
476 if (iface->get_row_header)
477 return (iface->get_row_header) (obj);
483 * atk_table_get_summary:
484 * @table: a GObject instance that implements AtkTableIface
486 * Gets the summary description of the table.
487 * Note: callers should not rely on %NULL or on a zero value for
488 * indication of whether AtkSelectionIface is implemented, they should
489 * use type checking/interface checking macros or the
490 * atk_get_accessible_table() convenience method.
492 * Returns: a AtkObject* representing a sumary description of the table,
493 * or %NULL if value does not implement this interface.
496 atk_table_get_summary (AtkTable *obj)
498 AtkTableIface *iface;
500 g_return_val_if_fail (obj != NULL, NULL);
501 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
503 iface = ATK_TABLE_GET_IFACE (obj);
505 if (iface->get_summary)
506 return (iface->get_summary) (obj);
512 * atk_table_get_selected_rows:
513 * @table: a GObject instance that implements AtkTableIface
515 * Gets the selected rows of the table.
516 * Note: callers should not rely on %NULL or on a zero value for
517 * indication of whether AtkSelectionIface is implemented, they should
518 * use type checking/interface checking macros or the
519 * atk_get_accessible_table() convenience method.
521 * Returns: a gint* representing the selected rows,
522 * or %NULL if value does not implement this interface.
525 atk_table_get_selected_rows (AtkTable *obj)
527 AtkTableIface *iface;
529 g_return_val_if_fail (obj != NULL, NULL);
530 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
532 iface = ATK_TABLE_GET_IFACE (obj);
534 if (iface->get_selected_rows)
535 return (iface->get_selected_rows) (obj);
541 * atk_table_get_selected_columns:
542 * @table: a GObject instance that implements AtkTableIface
544 * Gets the selected columns of the table.
545 * Note: callers should not rely on %NULL or on a zero value for
546 * indication of whether AtkSelectionIface is implemented, they should
547 * use type checking/interface checking macros or the
548 * atk_get_accessible_table() convenience method.
550 * Returns: a gint* representing the selected columns,
551 * or %NULL if value does not implement this interface.
555 atk_table_get_selected_columns (AtkTable *obj)
557 AtkTableIface *iface;
559 g_return_val_if_fail (obj != NULL, NULL);
560 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
562 iface = ATK_TABLE_GET_IFACE (obj);
564 if (iface->get_selected_columns)
565 return (iface->get_selected_columns) (obj);
571 * atk_table_is_column_selected:
572 * @table: a GObject instance that implements AtkTableIface
573 * @column: a #gint representing a column in @table
575 * Gets a boolean value indicating whether the specified @column
577 * Note: callers should not rely on %NULL or on a zero value for
578 * indication of whether AtkSelectionIface is implemented, they should
579 * use type checking/interface checking macros or the
580 * atk_get_accessible_table() convenience method.
582 * Returns: a gboolean representing if the column is selected, or 0
583 * if value does not implement this interface.
586 atk_table_is_column_selected (AtkTable *obj,
589 AtkTableIface *iface;
591 g_return_val_if_fail (obj != NULL, FALSE);
592 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
594 iface = ATK_TABLE_GET_IFACE (obj);
596 if (iface->is_column_selected)
597 return (iface->is_column_selected) (obj, column);
603 * atk_table_is_row_selected:
604 * @table: a GObject instance that implements AtkTableIface
605 * @row: a #gint representing a row in @table
607 * Gets a boolean value indicating whether the specified @row
609 * Note: callers should not rely on %NULL or on a zero value for
610 * indication of whether AtkSelectionIface is implemented, they should
611 * use type checking/interface checking macros or the
612 * atk_get_accessible_table() convenience method.
614 * Returns: a gboolean representing if the row is selected, or 0
615 * if value does not implement this interface.
618 atk_table_is_row_selected (AtkTable *obj,
621 AtkTableIface *iface;
623 g_return_val_if_fail (obj != NULL, FALSE);
624 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
626 iface = ATK_TABLE_GET_IFACE (obj);
628 if (iface->is_row_selected)
629 return (iface->is_row_selected) (obj, row);
635 * atk_table_is_selected:
636 * @table: a GObject instance that implements AtkTableIface
637 * @row: a #gint representing a row in @table
638 * @column: a #gint representing a column in @table
640 * Gets a boolean value indicating whether the acessible object
641 * at the specified @row and @column is selected
642 * Note: callers should not rely on %NULL or on a zero value for
643 * indication of whether AtkSelectionIface is implemented, they should
644 * use type checking/interface checking macros or the
645 * atk_get_accessible_table() convenience method.
647 * Returns: a gboolean representing if the cell is selected, or 0
648 * if value does not implement this interface.
651 atk_table_is_selected (AtkTable *obj,
655 AtkTableIface *iface;
657 g_return_val_if_fail (obj != NULL, FALSE);
658 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
660 iface = ATK_TABLE_GET_IFACE (obj);
662 if (iface->is_selected)
663 return (iface->is_selected) (obj, row, column);
669 * atk_table_set_caption:
670 * @table: a GObject instance that implements AtkTableIface
671 * @accessible: an #AtkObject representing the caption to set for @table
673 * Sets the caption for the table.
676 atk_table_set_caption (AtkTable *obj,
677 AtkObject *accessible)
679 AtkTableIface *iface;
681 g_return_if_fail (obj != NULL);
682 g_return_if_fail (ATK_IS_TABLE (obj));
684 iface = ATK_TABLE_GET_IFACE (obj);
686 if (iface->set_caption)
687 (iface->set_caption) (obj, accessible);
691 * atk_table_set_column_description:
692 * @table: a GObject instance that implements AtkTableIface
693 * @column: a #gint representing a column in @table
694 * @accessible: an #AtkObject representing the description text
695 * to set for the specified @column of the @table
697 * Sets the description text for the specified @column of the @table.
700 atk_table_set_column_description (AtkTable *obj,
702 AtkObject *accessible)
704 AtkTableIface *iface;
706 g_return_if_fail (obj != NULL);
707 g_return_if_fail (ATK_IS_TABLE (obj));
709 iface = ATK_TABLE_GET_IFACE (obj);
711 if (iface->set_column_description)
712 (iface->set_column_description) (obj, column, accessible);
716 * atk_table_set_column_header:
717 * @table: a GObject instance that implements AtkTableIface
718 * @column: a #gint representing a column in @table
719 * @header: an #AtkTable
721 * Sets the specified column header to @header
724 atk_table_set_column_header (AtkTable *obj,
728 AtkTableIface *iface;
730 g_return_if_fail (obj != NULL);
731 g_return_if_fail (ATK_IS_TABLE (obj));
733 iface = ATK_TABLE_GET_IFACE (obj);
735 if (iface->set_column_header)
736 (iface->set_column_header) (obj, column, header);
740 * atk_table_set_row_description:
741 * @table: a GObject instance that implements AtkTableIface
742 * @row: a #gint representing a row in @table
743 * @accessible: an #AtkObject representing the description text
744 * to set for the specified @row of @table
746 * Sets the description text for the specified @row of @table.
749 atk_table_set_row_description (AtkTable *obj,
751 AtkObject *accessible)
753 AtkTableIface *iface;
755 g_return_if_fail (obj != NULL);
756 g_return_if_fail (ATK_IS_TABLE (obj));
758 iface = ATK_TABLE_GET_IFACE (obj);
760 if (iface->set_row_description)
761 (iface->set_row_description) (obj, row, accessible);
765 * atk_table_set_row_header:
766 * @table: a GObject instance that implements AtkTableIface
767 * @row: a #gint representing a row in @table
768 * @header: an #AtkTable
770 * Sets the specified row header to @header
773 atk_table_set_row_header (AtkTable *obj,
777 AtkTableIface *iface;
779 g_return_if_fail (obj != NULL);
780 g_return_if_fail (ATK_IS_TABLE (obj));
782 iface = ATK_TABLE_GET_IFACE (obj);
784 if (iface->set_row_header)
785 (iface->set_row_header) (obj, row, header);
789 * atk_table_set_summary:
790 * @table: a GObject instance that implements AtkTableIface
791 * @accessible: an #AtkObject representing the summary description
794 * Sets the summary description of the table
797 atk_table_set_summary (AtkTable *obj,
798 AtkObject *accessible)
800 AtkTableIface *iface;
802 g_return_if_fail (obj != NULL);
803 g_return_if_fail (ATK_IS_TABLE (obj));
805 iface = ATK_TABLE_GET_IFACE (obj);
807 if (iface->set_summary)
808 (iface->set_summary) (obj, accessible);