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.
25 static GType type = 0;
30 sizeof (AtkTableIface),
32 (GBaseFinalizeFunc) NULL,
36 type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0);
44 * @table: a GObject instance that implements AtkTableIface
45 * @row: a #gint representing a row in @table
46 * @column: a #gint representing a column in @table
48 * Get a reference to the table cell at @row, @column
50 * Returns: a AtkObject* representing the referred to accessible
53 atk_table_ref_at (AtkTable *obj,
59 g_return_val_if_fail (obj != NULL, NULL);
60 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
62 iface = ATK_TABLE_GET_IFACE (obj);
65 return (iface->ref_at) (obj, row, column);
71 * atk_table_get_index_at:
72 * @table: a GObject instance that implements AtkTableIface
73 * @row: a #gint representing a row in @table
74 * @column: a #gint representing a column in @table
76 * Gets a #gint representing the index at the specified @row and @column,
77 * or 0 if value does not implement this interface.
78 * Note: callers should not rely on %NULL or on a zero value for
79 * indication of whether AtkSelectionIface is implemented, they should
80 * use type checking/interface checking macros or the
81 * atk_get_accessible_table() convenience method.
83 * Returns: a #gint representing the index at specified position, or 0
84 * if value does not implement this interface.
87 atk_table_get_index_at (AtkTable *obj,
93 g_return_val_if_fail (obj != NULL, 0);
94 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
96 iface = ATK_TABLE_GET_IFACE (obj);
98 if (iface->get_index_at)
99 return (iface->get_index_at) (obj, row, column);
105 * atk_table_get_row_at_index:
106 * @table: a GObject instance that implements AtkTableInterface
107 * @index: a #gint representing an index in @table
109 * Gets a #gint representing the row at the specified @index, or 0
110 * if the value does not implement this interface
111 * Note: callers should not rely on %NULL or on a zero value for
112 * indication of whether AtkSelectionIface is implemented, they should
113 * use type checking/interface checking macros or the
114 * atk_get_accessible_table() convenience method.
116 * Returns: a gint representing the row at the specified index, or 0
117 * if value does not implement this interface.
120 atk_table_get_row_at_index (AtkTable *obj,
123 AtkTableIface *iface;
125 g_return_val_if_fail (obj != NULL, 0);
126 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
128 iface = ATK_TABLE_GET_IFACE (obj);
130 if (iface->get_row_at_index)
131 return (iface->get_row_at_index) (obj, index);
137 * atk_table_get_column_at_index:
138 * @table: a GObject instance that implements AtkTableInterface
139 * @index: a #gint representing an index in @table
141 * Gets a #gint representing the column at the specified @index, or 0
142 * if the value does not implement this interface
143 * Note: callers should not rely on %NULL or on a zero value for
144 * indication of whether AtkSelectionIface is implemented, they should
145 * use type checking/interface checking macros or the
146 * atk_get_accessible_table() convenience method.
148 * Returns: a gint representing the column at the specified index, or 0
149 * if value does not implement this interface.
152 atk_table_get_column_at_index (AtkTable *obj,
155 AtkTableIface *iface;
157 g_return_val_if_fail (obj != NULL, 0);
158 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
160 iface = ATK_TABLE_GET_IFACE (obj);
162 if (iface->get_column_at_index)
163 return (iface->get_column_at_index) (obj, index);
169 * atk_table_get_caption:
170 * @table: a GObject instance that implements AtkTableInterface
172 * Gets the caption for the @table.
173 * Note: callers should not rely on %NULL or on a zero value for
174 * indication of whether AtkSelectionIface is implemented, they should
175 * use type checking/interface checking macros or the
176 * atk_get_accessible_table() convenience method.
178 * Returns: a AtkObject* representing the table caption, or %NULL
179 * if value does not implement this interface.
182 atk_table_get_caption (AtkTable *obj)
184 AtkTableIface *iface;
186 g_return_val_if_fail (obj != NULL, NULL);
187 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
189 iface = ATK_TABLE_GET_IFACE (obj);
191 if (iface->get_caption)
192 return (iface->get_caption) (obj);
198 * atk_table_get_n_columns:
199 * @table: a GObject instance that implements AtkTableIface
201 * Gets the number of columns in the table.
202 * Note: callers should not rely on %NULL or on a zero value for
203 * indication of whether AtkSelectionIface is implemented, they should
204 * use type checking/interface checking macros or the
205 * atk_get_accessible_table() convenience method.
207 * Returns: a gint representing the number of columns, or 0
208 * if value does not implement this interface.
211 atk_table_get_n_columns (AtkTable *obj)
213 AtkTableIface *iface;
215 g_return_val_if_fail (obj != NULL, 0);
216 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
218 iface = ATK_TABLE_GET_IFACE (obj);
220 if (iface->get_n_columns)
221 return (iface->get_n_columns) (obj);
227 * atk_table_get_column_description:
228 * @table: a GObject instance that implements AtkTableIface
229 * @column: a #gint representing a column in @table
231 * Gets the description text of the specified @column in the table
232 * Note: callers should not rely on %NULL or on a zero value for
233 * indication of whether AtkSelectionIface is implemented, they should
234 * use type checking/interface checking macros or the
235 * atk_get_accessible_table() convenience method.
237 * Returns: a AtkObject* representing the table description, or NULL
238 * if value does not implement this interface.
241 atk_table_get_column_description (AtkTable *obj,
244 AtkTableIface *iface;
246 g_return_val_if_fail (obj != NULL, NULL);
247 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
249 iface = ATK_TABLE_GET_IFACE (obj);
251 if (iface->get_column_description)
252 return (iface->get_column_description) (obj, column);
258 * atk_table_get_column_extent_at:
259 * @table: a GObject instance that implements AtkTableIface
260 * @row: a #gint representing a row in @table
261 * @column: a #gint representing a column in @table
263 * Gets the number of columns occupied by the accessible object
264 * at the specified @row and @column in the @table.
265 * Note: callers should not rely on %NULL or on a zero value for
266 * indication of whether AtkSelectionIface is implemented, they should
267 * use type checking/interface checking macros or the
268 * atk_get_accessible_table() convenience method.
270 * Returns: a gint representing the column extent at specified position, or 0
271 * if value does not implement this interface.
274 atk_table_get_column_extent_at (AtkTable *obj,
278 AtkTableIface *iface;
280 g_return_val_if_fail (obj != NULL, 0);
281 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
283 iface = ATK_TABLE_GET_IFACE (obj);
285 if (iface->get_column_extent_at)
286 return (iface->get_column_extent_at) (obj, row, column);
292 * atk_table_get_column_header:
293 * @table: a GObject instance that implements AtkTableIface
295 * Gets the column headers of an accessible table.
296 * Note: callers should not rely on %NULL or on a zero value for
297 * indication of whether AtkSelectionIface is implemented, they should
298 * use type checking/interface checking macros or the
299 * atk_get_accessible_table() convenience method.
301 * Returns: a AtkObject* representing the column headers, or %NULL
302 * if value does not implement this interface.
305 atk_table_get_column_header (AtkTable *obj)
307 AtkTableIface *iface;
309 g_return_val_if_fail (obj != NULL, NULL);
310 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
312 iface = ATK_TABLE_GET_IFACE (obj);
314 if (iface->get_column_header)
315 return (iface->get_column_header) (obj);
321 * atk_table_get_n_rows:
322 * @table: a GObject instance that implements AtkTableIface
324 * Gets the number of rows in the table.
325 * Note: callers should not rely on %NULL or on a zero value for
326 * indication of whether AtkSelectionIface is implemented, they should
327 * use type checking/interface checking macros or the
328 * atk_get_accessible_table() convenience method.
330 * Returns: a gint representing the number of rows, or 0
331 * if value does not implement this interface.
334 atk_table_get_n_rows (AtkTable *obj)
336 AtkTableIface *iface;
338 g_return_val_if_fail (obj != NULL, 0);
339 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
341 iface = ATK_TABLE_GET_IFACE (obj);
343 if (iface->get_n_rows)
344 return (iface->get_n_rows) (obj);
350 * atk_table_get_row_description:
351 * @table: a GObject instance that implements AtkTableIface
352 * @r: a #gint representing a row in @table
354 * Gets the description text of the specified row in the table
355 * Note: callers should not rely on %NULL or on a zero value for
356 * indication of whether AtkSelectionIface is implemented, they should
357 * use type checking/interface checking macros or the
358 * atk_get_accessible_table() convenience method.
360 * Returns: a AtkObject* representing the table description, or %NULL
361 * if value does not implement this interface.
364 atk_table_get_row_description (AtkTable *obj,
367 AtkTableIface *iface;
369 g_return_val_if_fail (obj != NULL, NULL);
370 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
372 iface = ATK_TABLE_GET_IFACE (obj);
374 if (iface->get_row_description)
375 return (iface->get_row_description) (obj, row);
381 * atk_table_get_row_extent_at:
382 * @table: a GObject instance that implements AtkTableIface
383 * @row: a #gint representing a row in @table
384 * @column: a #gint representing a column in @table
386 * Gets the number of rows occupied by the accessible object
387 * at a specified @row and @column in the @table.
388 * Note: callers should not rely on %NULL or on a zero value for
389 * indication of whether AtkSelectionIface is implemented, they should
390 * use type checking/interface checking macros or the
391 * atk_get_accessible_table() convenience method.
393 * Returns: a gint representing the row extent at specified position, or 0
394 * if value does not implement this interface.
397 atk_table_get_row_extent_at (AtkTable *obj,
401 AtkTableIface *iface;
403 g_return_val_if_fail (obj != NULL, 0);
404 g_return_val_if_fail (ATK_IS_TABLE (obj), 0);
406 iface = ATK_TABLE_GET_IFACE (obj);
408 if (iface->get_row_extent_at)
409 return (iface->get_row_extent_at) (obj, row, column);
415 * atk_table_get_row_header:
416 * @table: a GObject instance that implements AtkTableIface
418 * Gets the row headers of an accessible table.
419 * Note: callers should not rely on %NULL or on a zero value for
420 * indication of whether AtkSelectionIface is implemented, they should
421 * use type checking/interface checking macros or the
422 * atk_get_accessible_table() convenience method.
424 * Returns: a AtkTable* representing the row headers, or %NULL
425 * if value does not implement this interface.
428 atk_table_get_row_header (AtkTable *obj)
430 AtkTableIface *iface;
432 g_return_val_if_fail (obj != NULL, NULL);
433 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
435 iface = ATK_TABLE_GET_IFACE (obj);
437 if (iface->get_row_header)
438 return (iface->get_row_header) (obj);
444 * atk_table_get_summary:
445 * @table: a GObject instance that implements AtkTableIface
447 * Gets the summary description of the table.
448 * Note: callers should not rely on %NULL or on a zero value for
449 * indication of whether AtkSelectionIface is implemented, they should
450 * use type checking/interface checking macros or the
451 * atk_get_accessible_table() convenience method.
453 * Returns: a AtkObject* representing a sumary description of the table,
454 * or %NULL if value does not implement this interface.
457 atk_table_get_summary (AtkTable *obj)
459 AtkTableIface *iface;
461 g_return_val_if_fail (obj != NULL, NULL);
462 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
464 iface = ATK_TABLE_GET_IFACE (obj);
466 if (iface->get_summary)
467 return (iface->get_summary) (obj);
473 * atk_table_get_selected_rows:
474 * @table: a GObject instance that implements AtkTableIface
476 * Gets the selected rows of the table.
477 * Note: callers should not rely on %NULL or on a zero value for
478 * indication of whether AtkSelectionIface is implemented, they should
479 * use type checking/interface checking macros or the
480 * atk_get_accessible_table() convenience method.
482 * Returns: a gint* representing the selected rows,
483 * or %NULL if value does not implement this interface.
486 atk_table_get_selected_rows (AtkTable *obj)
488 AtkTableIface *iface;
490 g_return_val_if_fail (obj != NULL, NULL);
491 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
493 iface = ATK_TABLE_GET_IFACE (obj);
495 if (iface->get_selected_rows)
496 return (iface->get_selected_rows) (obj);
502 * atk_table_get_selected_columns:
503 * @table: a GObject instance that implements AtkTableIface
505 * Gets the selected columns of the table.
506 * Note: callers should not rely on %NULL or on a zero value for
507 * indication of whether AtkSelectionIface is implemented, they should
508 * use type checking/interface checking macros or the
509 * atk_get_accessible_table() convenience method.
511 * Returns: a gint* representing the selected columns,
512 * or %NULL if value does not implement this interface.
516 atk_table_get_selected_columns (AtkTable *obj)
518 AtkTableIface *iface;
520 g_return_val_if_fail (obj != NULL, NULL);
521 g_return_val_if_fail (ATK_IS_TABLE (obj), NULL);
523 iface = ATK_TABLE_GET_IFACE (obj);
525 if (iface->get_selected_columns)
526 return (iface->get_selected_columns) (obj);
532 * atk_table_is_column_selected:
533 * @table: a GObject instance that implements AtkTableIface
534 * @column: a #gint representing a column in @table
536 * Gets a boolean value indicating whether the specified @column
538 * Note: callers should not rely on %NULL or on a zero value for
539 * indication of whether AtkSelectionIface is implemented, they should
540 * use type checking/interface checking macros or the
541 * atk_get_accessible_table() convenience method.
543 * Returns: a gboolean representing if the column is selected, or 0
544 * if value does not implement this interface.
547 atk_table_is_column_selected (AtkTable *obj,
550 AtkTableIface *iface;
552 g_return_val_if_fail (obj != NULL, FALSE);
553 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
555 iface = ATK_TABLE_GET_IFACE (obj);
557 if (iface->is_column_selected)
558 return (iface->is_column_selected) (obj, column);
564 * atk_table_is_row_selected:
565 * @table: a GObject instance that implements AtkTableIface
566 * @row: a #gint representing a row in @table
568 * Gets a boolean value indicating whether the specified @row
570 * Note: callers should not rely on %NULL or on a zero value for
571 * indication of whether AtkSelectionIface is implemented, they should
572 * use type checking/interface checking macros or the
573 * atk_get_accessible_table() convenience method.
575 * Returns: a gboolean representing if the row is selected, or 0
576 * if value does not implement this interface.
579 atk_table_is_row_selected (AtkTable *obj,
582 AtkTableIface *iface;
584 g_return_val_if_fail (obj != NULL, FALSE);
585 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
587 iface = ATK_TABLE_GET_IFACE (obj);
589 if (iface->is_row_selected)
590 return (iface->is_row_selected) (obj, row);
596 * atk_table_is_selected:
597 * @table: a GObject instance that implements AtkTableIface
598 * @row: a #gint representing a row in @table
599 * @column: a #gint representing a column in @table
601 * Gets a boolean value indicating whether the acessible object
602 * at the specified @row and @column is selected
603 * Note: callers should not rely on %NULL or on a zero value for
604 * indication of whether AtkSelectionIface is implemented, they should
605 * use type checking/interface checking macros or the
606 * atk_get_accessible_table() convenience method.
608 * Returns: a gboolean representing if the cell is selected, or 0
609 * if value does not implement this interface.
612 atk_table_is_selected (AtkTable *obj,
616 AtkTableIface *iface;
618 g_return_val_if_fail (obj != NULL, FALSE);
619 g_return_val_if_fail (ATK_IS_TABLE (obj), FALSE);
621 iface = ATK_TABLE_GET_IFACE (obj);
623 if (iface->is_selected)
624 return (iface->is_selected) (obj, row, column);
630 * atk_table_set_caption:
631 * @table: a GObject instance that implements AtkTableIface
632 * @accessible: an #AtkObject representing the caption to set for @table
634 * Sets the caption for the table.
637 atk_table_set_caption (AtkTable *obj,
638 AtkObject *accessible)
640 AtkTableIface *iface;
642 g_return_if_fail (obj != NULL);
643 g_return_if_fail (ATK_IS_TABLE (obj));
645 iface = ATK_TABLE_GET_IFACE (obj);
647 if (iface->set_caption)
648 (iface->set_caption) (obj, accessible);
652 * atk_table_set_column_description:
653 * @table: a GObject instance that implements AtkTableIface
654 * @column: a #gint representing a column in @table
655 * @accessible: an #AtkObject representing the description text
656 * to set for the specified @column of the @table
658 * Sets the description text for the specified @column of the @table.
661 atk_table_set_column_description (AtkTable *obj,
663 AtkObject *accessible)
665 AtkTableIface *iface;
667 g_return_if_fail (obj != NULL);
668 g_return_if_fail (ATK_IS_TABLE (obj));
670 iface = ATK_TABLE_GET_IFACE (obj);
672 if (iface->set_column_description)
673 (iface->set_column_description) (obj, column, accessible);
677 * atk_table_set_column_header:
678 * @table: a GObject instance that implements AtkTableIface
679 * @column: a #gint representing a column in @table
680 * @header: an #AtkTable
682 * Sets the specified column header to @header
685 atk_table_set_column_header (AtkTable *obj,
689 AtkTableIface *iface;
691 g_return_if_fail (obj != NULL);
692 g_return_if_fail (ATK_IS_TABLE (obj));
694 iface = ATK_TABLE_GET_IFACE (obj);
696 if (iface->set_column_header)
697 (iface->set_column_header) (obj, column, header);
701 * atk_table_set_row_description:
702 * @table: a GObject instance that implements AtkTableIface
703 * @row: a #gint representing a row in @table
704 * @accessible: an #AtkObject representing the description text
705 * to set for the specified @row of @table
707 * Sets the description text for the specified @row of @table.
710 atk_table_set_row_description (AtkTable *obj,
712 AtkObject *accessible)
714 AtkTableIface *iface;
716 g_return_if_fail (obj != NULL);
717 g_return_if_fail (ATK_IS_TABLE (obj));
719 iface = ATK_TABLE_GET_IFACE (obj);
721 if (iface->set_row_description)
722 (iface->set_row_description) (obj, row, accessible);
726 * atk_table_set_row_header:
727 * @table: a GObject instance that implements AtkTableIface
728 * @row: a #gint representing a row in @table
729 * @header: an #AtkTable
731 * Sets the specified row header to @header
734 atk_table_set_row_header (AtkTable *obj,
738 AtkTableIface *iface;
740 g_return_if_fail (obj != NULL);
741 g_return_if_fail (ATK_IS_TABLE (obj));
743 iface = ATK_TABLE_GET_IFACE (obj);
745 if (iface->set_row_header)
746 (iface->set_row_header) (obj, row, header);
750 * atk_table_set_summary:
751 * @table: a GObject instance that implements AtkTableIface
752 * @accessible: an #AtkObject representing the summary description
755 * Sets the summary description of the table
758 atk_table_set_summary (AtkTable *obj,
759 AtkObject *accessible)
761 AtkTableIface *iface;
763 g_return_if_fail (obj != NULL);
764 g_return_if_fail (ATK_IS_TABLE (obj));
766 iface = ATK_TABLE_GET_IFACE (obj);
768 if (iface->set_summary)
769 (iface->set_summary) (obj, accessible);