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 "atktable.h" |
---|
21 | #include "atkmarshal.h" |
---|
22 | |
---|
23 | enum { |
---|
24 | ROW_INSERTED, |
---|
25 | ROW_DELETED, |
---|
26 | COLUMN_INSERTED, |
---|
27 | COLUMN_DELETED, |
---|
28 | ROW_REORDERED, |
---|
29 | COLUMN_REORDERED, |
---|
30 | MODEL_CHANGED, |
---|
31 | LAST_SIGNAL |
---|
32 | }; |
---|
33 | |
---|
34 | static void atk_table_base_init (gpointer *g_class); |
---|
35 | |
---|
36 | static guint atk_table_signals[LAST_SIGNAL] = { 0 }; |
---|
37 | |
---|
38 | GType |
---|
39 | atk_table_get_type (void) |
---|
40 | { |
---|
41 | static GType type = 0; |
---|
42 | |
---|
43 | if (!type) { |
---|
44 | GTypeInfo tinfo = |
---|
45 | { |
---|
46 | sizeof (AtkTableIface), |
---|
47 | (GBaseInitFunc) atk_table_base_init, |
---|
48 | (GBaseFinalizeFunc) NULL, |
---|
49 | |
---|
50 | }; |
---|
51 | |
---|
52 | type = g_type_register_static (G_TYPE_INTERFACE, "AtkTable", &tinfo, 0); |
---|
53 | } |
---|
54 | |
---|
55 | return type; |
---|
56 | } |
---|
57 | |
---|
58 | |
---|
59 | static void |
---|
60 | atk_table_base_init (gpointer *g_class) |
---|
61 | { |
---|
62 | static gboolean initialized = FALSE; |
---|
63 | |
---|
64 | if (!initialized) |
---|
65 | { |
---|
66 | atk_table_signals[ROW_INSERTED] = |
---|
67 | g_signal_new ("row_inserted", |
---|
68 | ATK_TYPE_TABLE, |
---|
69 | G_SIGNAL_RUN_LAST, |
---|
70 | G_STRUCT_OFFSET (AtkTableIface, row_inserted), |
---|
71 | (GSignalAccumulator) NULL, NULL, |
---|
72 | atk_marshal_VOID__INT_INT, |
---|
73 | G_TYPE_NONE, |
---|
74 | 2, G_TYPE_INT, G_TYPE_INT); |
---|
75 | atk_table_signals[COLUMN_INSERTED] = |
---|
76 | g_signal_new ("column_inserted", |
---|
77 | ATK_TYPE_TABLE, |
---|
78 | G_SIGNAL_RUN_LAST, |
---|
79 | G_STRUCT_OFFSET (AtkTableIface, column_inserted), |
---|
80 | (GSignalAccumulator) NULL, NULL, |
---|
81 | atk_marshal_VOID__INT_INT, |
---|
82 | G_TYPE_NONE, |
---|
83 | 2, G_TYPE_INT, G_TYPE_INT); |
---|
84 | atk_table_signals[ROW_DELETED] = |
---|
85 | g_signal_new ("row_deleted", |
---|
86 | ATK_TYPE_TABLE, |
---|
87 | G_SIGNAL_RUN_LAST, |
---|
88 | G_STRUCT_OFFSET (AtkTableIface, row_deleted), |
---|
89 | (GSignalAccumulator) NULL, NULL, |
---|
90 | atk_marshal_VOID__INT_INT, |
---|
91 | G_TYPE_NONE, |
---|
92 | 2, G_TYPE_INT, G_TYPE_INT); |
---|
93 | atk_table_signals[COLUMN_DELETED] = |
---|
94 | g_signal_new ("column_deleted", |
---|
95 | ATK_TYPE_TABLE, |
---|
96 | G_SIGNAL_RUN_LAST, |
---|
97 | G_STRUCT_OFFSET (AtkTableIface, column_deleted), |
---|
98 | (GSignalAccumulator) NULL, NULL, |
---|
99 | atk_marshal_VOID__INT_INT, |
---|
100 | G_TYPE_NONE, |
---|
101 | 2, G_TYPE_INT, G_TYPE_INT); |
---|
102 | atk_table_signals[ROW_REORDERED] = |
---|
103 | g_signal_new ("row_reordered", |
---|
104 | ATK_TYPE_TABLE, |
---|
105 | G_SIGNAL_RUN_LAST, |
---|
106 | G_STRUCT_OFFSET (AtkTableIface, row_reordered), |
---|
107 | (GSignalAccumulator) NULL, NULL, |
---|
108 | g_cclosure_marshal_VOID__VOID, |
---|
109 | G_TYPE_NONE, |
---|
110 | 0); |
---|
111 | atk_table_signals[COLUMN_REORDERED] = |
---|
112 | g_signal_new ("column_reordered", |
---|
113 | ATK_TYPE_TABLE, |
---|
114 | G_SIGNAL_RUN_LAST, |
---|
115 | G_STRUCT_OFFSET (AtkTableIface, column_reordered), |
---|
116 | (GSignalAccumulator) NULL, NULL, |
---|
117 | g_cclosure_marshal_VOID__VOID, |
---|
118 | G_TYPE_NONE, |
---|
119 | 0); |
---|
120 | atk_table_signals[MODEL_CHANGED] = |
---|
121 | g_signal_new ("model_changed", |
---|
122 | ATK_TYPE_TABLE, |
---|
123 | G_SIGNAL_RUN_LAST, |
---|
124 | G_STRUCT_OFFSET (AtkTableIface, model_changed), |
---|
125 | (GSignalAccumulator) NULL, NULL, |
---|
126 | g_cclosure_marshal_VOID__VOID, |
---|
127 | G_TYPE_NONE, 0); |
---|
128 | |
---|
129 | initialized = TRUE; |
---|
130 | } |
---|
131 | } |
---|
132 | |
---|
133 | /** |
---|
134 | * atk_table_ref_at: |
---|
135 | * @table: a GObject instance that implements AtkTableIface |
---|
136 | * @row: a #gint representing a row in @table |
---|
137 | * @column: a #gint representing a column in @table |
---|
138 | * |
---|
139 | * Get a reference to the table cell at @row, @column. |
---|
140 | * |
---|
141 | * Returns: a AtkObject* representing the referred to accessible |
---|
142 | **/ |
---|
143 | AtkObject* |
---|
144 | atk_table_ref_at (AtkTable *table, |
---|
145 | gint row, |
---|
146 | gint column) |
---|
147 | { |
---|
148 | AtkTableIface *iface; |
---|
149 | |
---|
150 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
151 | g_return_val_if_fail (row >= 0, NULL); |
---|
152 | g_return_val_if_fail (column >= 0, NULL); |
---|
153 | |
---|
154 | iface = ATK_TABLE_GET_IFACE (table); |
---|
155 | |
---|
156 | if (iface->ref_at) |
---|
157 | return (iface->ref_at) (table, row, column); |
---|
158 | else |
---|
159 | return NULL; |
---|
160 | } |
---|
161 | |
---|
162 | /** |
---|
163 | * atk_table_get_index_at: |
---|
164 | * @table: a GObject instance that implements AtkTableIface |
---|
165 | * @row: a #gint representing a row in @table |
---|
166 | * @column: a #gint representing a column in @table |
---|
167 | * |
---|
168 | * Gets a #gint representing the index at the specified @row and @column. |
---|
169 | * The value -1 is returned if the object at row,column is not a child |
---|
170 | * of table or table does not implement this interface. |
---|
171 | * |
---|
172 | * Returns: a #gint representing the index at specified position |
---|
173 | **/ |
---|
174 | gint |
---|
175 | atk_table_get_index_at (AtkTable *table, |
---|
176 | gint row, |
---|
177 | gint column) |
---|
178 | { |
---|
179 | AtkTableIface *iface; |
---|
180 | |
---|
181 | g_return_val_if_fail (ATK_IS_TABLE (table), -1); |
---|
182 | g_return_val_if_fail (row >= 0, -1); |
---|
183 | g_return_val_if_fail (column >= 0, -1); |
---|
184 | |
---|
185 | iface = ATK_TABLE_GET_IFACE (table); |
---|
186 | |
---|
187 | if (iface->get_index_at) |
---|
188 | return (iface->get_index_at) (table, row, column); |
---|
189 | else |
---|
190 | return -1; |
---|
191 | } |
---|
192 | |
---|
193 | /** |
---|
194 | * atk_table_get_row_at_index: |
---|
195 | * @table: a GObject instance that implements AtkTableInterface |
---|
196 | * @index_: a #gint representing an index in @table |
---|
197 | * |
---|
198 | * Gets a #gint representing the row at the specified @index_, or -1 |
---|
199 | * if the table does not implement this interface |
---|
200 | * |
---|
201 | * Returns: a gint representing the row at the specified index. |
---|
202 | **/ |
---|
203 | gint |
---|
204 | atk_table_get_row_at_index (AtkTable *table, |
---|
205 | gint index) |
---|
206 | { |
---|
207 | AtkTableIface *iface; |
---|
208 | |
---|
209 | g_return_val_if_fail (ATK_IS_TABLE (table), -1); |
---|
210 | |
---|
211 | iface = ATK_TABLE_GET_IFACE (table); |
---|
212 | |
---|
213 | if (iface->get_row_at_index) |
---|
214 | return (iface->get_row_at_index) (table, index); |
---|
215 | else |
---|
216 | return -1; |
---|
217 | } |
---|
218 | |
---|
219 | /** |
---|
220 | * atk_table_get_column_at_index: |
---|
221 | * @table: a GObject instance that implements AtkTableInterface |
---|
222 | * @index_: a #gint representing an index in @table |
---|
223 | * |
---|
224 | * Gets a #gint representing the column at the specified @index_, or -1 |
---|
225 | * if the table does not implement this interface |
---|
226 | * |
---|
227 | * Returns: a gint representing the column at the specified index. |
---|
228 | **/ |
---|
229 | gint |
---|
230 | atk_table_get_column_at_index (AtkTable *table, |
---|
231 | gint index) |
---|
232 | { |
---|
233 | AtkTableIface *iface; |
---|
234 | |
---|
235 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
236 | |
---|
237 | iface = ATK_TABLE_GET_IFACE (table); |
---|
238 | |
---|
239 | if (iface->get_column_at_index) |
---|
240 | return (iface->get_column_at_index) (table, index); |
---|
241 | else |
---|
242 | return -1; |
---|
243 | } |
---|
244 | |
---|
245 | /** |
---|
246 | * atk_table_get_caption: |
---|
247 | * @table: a GObject instance that implements AtkTableInterface |
---|
248 | * |
---|
249 | * Gets the caption for the @table. |
---|
250 | * |
---|
251 | * Returns: a AtkObject* representing the table caption, or %NULL |
---|
252 | * if value does not implement this interface. |
---|
253 | **/ |
---|
254 | AtkObject* |
---|
255 | atk_table_get_caption (AtkTable *table) |
---|
256 | { |
---|
257 | AtkTableIface *iface; |
---|
258 | |
---|
259 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
260 | |
---|
261 | iface = ATK_TABLE_GET_IFACE (table); |
---|
262 | |
---|
263 | if (iface->get_caption) |
---|
264 | return (iface->get_caption) (table); |
---|
265 | else |
---|
266 | return NULL; |
---|
267 | } |
---|
268 | |
---|
269 | /** |
---|
270 | * atk_table_get_n_columns: |
---|
271 | * @table: a GObject instance that implements AtkTableIface |
---|
272 | * |
---|
273 | * Gets the number of columns in the table. |
---|
274 | * |
---|
275 | * Returns: a gint representing the number of columns, or 0 |
---|
276 | * if value does not implement this interface. |
---|
277 | **/ |
---|
278 | gint |
---|
279 | atk_table_get_n_columns (AtkTable *table) |
---|
280 | { |
---|
281 | AtkTableIface *iface; |
---|
282 | |
---|
283 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
284 | |
---|
285 | iface = ATK_TABLE_GET_IFACE (table); |
---|
286 | |
---|
287 | if (iface->get_n_columns) |
---|
288 | return (iface->get_n_columns) (table); |
---|
289 | else |
---|
290 | return 0; |
---|
291 | } |
---|
292 | |
---|
293 | /** |
---|
294 | * atk_table_get_column_description: |
---|
295 | * @table: a GObject instance that implements AtkTableIface |
---|
296 | * @column: a #gint representing a column in @table |
---|
297 | * |
---|
298 | * Gets the description text of the specified @column in the table |
---|
299 | * |
---|
300 | * Returns: a gchar* representing the column description, or %NULL |
---|
301 | * if value does not implement this interface. |
---|
302 | **/ |
---|
303 | G_CONST_RETURN gchar* |
---|
304 | atk_table_get_column_description (AtkTable *table, |
---|
305 | gint column) |
---|
306 | { |
---|
307 | AtkTableIface *iface; |
---|
308 | |
---|
309 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
310 | |
---|
311 | iface = ATK_TABLE_GET_IFACE (table); |
---|
312 | |
---|
313 | if (iface->get_column_description) |
---|
314 | return (iface->get_column_description) (table, column); |
---|
315 | else |
---|
316 | return NULL; |
---|
317 | } |
---|
318 | |
---|
319 | /** |
---|
320 | * atk_table_get_column_extent_at: |
---|
321 | * @table: a GObject instance that implements AtkTableIface |
---|
322 | * @row: a #gint representing a row in @table |
---|
323 | * @column: a #gint representing a column in @table |
---|
324 | * |
---|
325 | * Gets the number of columns occupied by the accessible object |
---|
326 | * at the specified @row and @column in the @table. |
---|
327 | * |
---|
328 | * Returns: a gint representing the column extent at specified position, or 0 |
---|
329 | * if value does not implement this interface. |
---|
330 | **/ |
---|
331 | gint |
---|
332 | atk_table_get_column_extent_at (AtkTable *table, |
---|
333 | gint row, |
---|
334 | gint column) |
---|
335 | { |
---|
336 | AtkTableIface *iface; |
---|
337 | |
---|
338 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
339 | |
---|
340 | iface = ATK_TABLE_GET_IFACE (table); |
---|
341 | |
---|
342 | if (iface->get_column_extent_at) |
---|
343 | return (iface->get_column_extent_at) (table, row, column); |
---|
344 | else |
---|
345 | return 0; |
---|
346 | } |
---|
347 | |
---|
348 | /** |
---|
349 | * atk_table_get_column_header: |
---|
350 | * @table: a GObject instance that implements AtkTableIface |
---|
351 | * @column: a #gint representing a column in the table |
---|
352 | * |
---|
353 | * Gets the column header of a specified column in an accessible table. |
---|
354 | * |
---|
355 | * Returns: a AtkObject* representing the specified column header, or |
---|
356 | * %NULL if value does not implement this interface. |
---|
357 | **/ |
---|
358 | AtkObject* |
---|
359 | atk_table_get_column_header (AtkTable *table, gint column) |
---|
360 | { |
---|
361 | AtkTableIface *iface; |
---|
362 | |
---|
363 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
364 | |
---|
365 | iface = ATK_TABLE_GET_IFACE (table); |
---|
366 | |
---|
367 | if (iface->get_column_header) |
---|
368 | return (iface->get_column_header) (table, column); |
---|
369 | else |
---|
370 | return NULL; |
---|
371 | } |
---|
372 | |
---|
373 | /** |
---|
374 | * atk_table_get_n_rows: |
---|
375 | * @table: a GObject instance that implements AtkTableIface |
---|
376 | * |
---|
377 | * Gets the number of rows in the table. |
---|
378 | * |
---|
379 | * Returns: a gint representing the number of rows, or 0 |
---|
380 | * if value does not implement this interface. |
---|
381 | **/ |
---|
382 | gint |
---|
383 | atk_table_get_n_rows (AtkTable *table) |
---|
384 | { |
---|
385 | AtkTableIface *iface; |
---|
386 | |
---|
387 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
388 | |
---|
389 | iface = ATK_TABLE_GET_IFACE (table); |
---|
390 | |
---|
391 | if (iface->get_n_rows) |
---|
392 | return (iface->get_n_rows) (table); |
---|
393 | else |
---|
394 | return 0; |
---|
395 | } |
---|
396 | |
---|
397 | /** |
---|
398 | * atk_table_get_row_description: |
---|
399 | * @table: a GObject instance that implements AtkTableIface |
---|
400 | * @row: a #gint representing a row in @table |
---|
401 | * |
---|
402 | * Gets the description text of the specified row in the table |
---|
403 | * |
---|
404 | * Returns: a gchar* representing the row description, or %NULL |
---|
405 | * if value does not implement this interface. |
---|
406 | **/ |
---|
407 | G_CONST_RETURN gchar* |
---|
408 | atk_table_get_row_description (AtkTable *table, |
---|
409 | gint row) |
---|
410 | { |
---|
411 | AtkTableIface *iface; |
---|
412 | |
---|
413 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
414 | |
---|
415 | iface = ATK_TABLE_GET_IFACE (table); |
---|
416 | |
---|
417 | if (iface->get_row_description) |
---|
418 | return (iface->get_row_description) (table, row); |
---|
419 | else |
---|
420 | return NULL; |
---|
421 | } |
---|
422 | |
---|
423 | /** |
---|
424 | * atk_table_get_row_extent_at: |
---|
425 | * @table: a GObject instance that implements AtkTableIface |
---|
426 | * @row: a #gint representing a row in @table |
---|
427 | * @column: a #gint representing a column in @table |
---|
428 | * |
---|
429 | * Gets the number of rows occupied by the accessible object |
---|
430 | * at a specified @row and @column in the @table. |
---|
431 | * |
---|
432 | * Returns: a gint representing the row extent at specified position, or 0 |
---|
433 | * if value does not implement this interface. |
---|
434 | **/ |
---|
435 | gint |
---|
436 | atk_table_get_row_extent_at (AtkTable *table, |
---|
437 | gint row, |
---|
438 | gint column) |
---|
439 | { |
---|
440 | AtkTableIface *iface; |
---|
441 | |
---|
442 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
443 | |
---|
444 | iface = ATK_TABLE_GET_IFACE (table); |
---|
445 | |
---|
446 | if (iface->get_row_extent_at) |
---|
447 | return (iface->get_row_extent_at) (table, row, column); |
---|
448 | else |
---|
449 | return 0; |
---|
450 | } |
---|
451 | |
---|
452 | /** |
---|
453 | * atk_table_get_row_header: |
---|
454 | * @table: a GObject instance that implements AtkTableIface |
---|
455 | * @row: a #gint representing a row in the table |
---|
456 | * |
---|
457 | * Gets the row header of a specified row in an accessible table. |
---|
458 | * |
---|
459 | * Returns: a AtkObject* representing the specified row header, or |
---|
460 | * %NULL if value does not implement this interface. |
---|
461 | **/ |
---|
462 | AtkObject* |
---|
463 | atk_table_get_row_header (AtkTable *table, gint row) |
---|
464 | { |
---|
465 | AtkTableIface *iface; |
---|
466 | |
---|
467 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
468 | |
---|
469 | iface = ATK_TABLE_GET_IFACE (table); |
---|
470 | |
---|
471 | if (iface->get_row_header) |
---|
472 | return (iface->get_row_header) (table, row); |
---|
473 | else |
---|
474 | return NULL; |
---|
475 | } |
---|
476 | |
---|
477 | /** |
---|
478 | * atk_table_get_summary: |
---|
479 | * @table: a GObject instance that implements AtkTableIface |
---|
480 | * |
---|
481 | * Gets the summary description of the table. |
---|
482 | * |
---|
483 | * Returns: a AtkObject* representing a summary description of the table, |
---|
484 | * or zero if value does not implement this interface. |
---|
485 | **/ |
---|
486 | AtkObject* |
---|
487 | atk_table_get_summary (AtkTable *table) |
---|
488 | { |
---|
489 | AtkTableIface *iface; |
---|
490 | |
---|
491 | g_return_val_if_fail (ATK_IS_TABLE (table), NULL); |
---|
492 | |
---|
493 | iface = ATK_TABLE_GET_IFACE (table); |
---|
494 | |
---|
495 | if (iface->get_summary) |
---|
496 | return (iface->get_summary) (table); |
---|
497 | else |
---|
498 | return NULL; |
---|
499 | } |
---|
500 | |
---|
501 | /** |
---|
502 | * atk_table_get_selected_rows: |
---|
503 | * @table: a GObject instance that implements AtkTableIface |
---|
504 | * @selected: a #gint** that is to contain the selected row numbers |
---|
505 | * |
---|
506 | * Gets the selected rows of the table by initializing **selected with |
---|
507 | * the selected row numbers. This array should be freed by the caller. |
---|
508 | * |
---|
509 | * Returns: a gint representing the number of selected rows, |
---|
510 | * or zero if value does not implement this interface. |
---|
511 | **/ |
---|
512 | gint |
---|
513 | atk_table_get_selected_rows (AtkTable *table, gint **selected) |
---|
514 | { |
---|
515 | AtkTableIface *iface; |
---|
516 | |
---|
517 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
518 | |
---|
519 | iface = ATK_TABLE_GET_IFACE (table); |
---|
520 | |
---|
521 | if (iface->get_selected_rows) |
---|
522 | return (iface->get_selected_rows) (table, selected); |
---|
523 | else |
---|
524 | return 0; |
---|
525 | } |
---|
526 | |
---|
527 | /** |
---|
528 | * atk_table_get_selected_columns: |
---|
529 | * @table: a GObject instance that implements AtkTableIface |
---|
530 | * @selected: a #gint** that is to contain the selected columns numbers |
---|
531 | * |
---|
532 | * Gets the selected columns of the table by initializing **selected with |
---|
533 | * the selected column numbers. This array should be freed by the caller. |
---|
534 | * |
---|
535 | * Returns: a gint representing the number of selected columns, |
---|
536 | * or %0 if value does not implement this interface. |
---|
537 | **/ |
---|
538 | gint |
---|
539 | atk_table_get_selected_columns (AtkTable *table, gint **selected) |
---|
540 | { |
---|
541 | AtkTableIface *iface; |
---|
542 | |
---|
543 | g_return_val_if_fail (ATK_IS_TABLE (table), 0); |
---|
544 | |
---|
545 | iface = ATK_TABLE_GET_IFACE (table); |
---|
546 | |
---|
547 | if (iface->get_selected_columns) |
---|
548 | return (iface->get_selected_columns) (table, selected); |
---|
549 | else |
---|
550 | return 0; |
---|
551 | } |
---|
552 | |
---|
553 | /** |
---|
554 | * atk_table_is_column_selected: |
---|
555 | * @table: a GObject instance that implements AtkTableIface |
---|
556 | * @column: a #gint representing a column in @table |
---|
557 | * |
---|
558 | * Gets a boolean value indicating whether the specified @column |
---|
559 | * is selected |
---|
560 | * |
---|
561 | * Returns: a gboolean representing if the column is selected, or 0 |
---|
562 | * if value does not implement this interface. |
---|
563 | **/ |
---|
564 | gboolean |
---|
565 | atk_table_is_column_selected (AtkTable *table, |
---|
566 | gint column) |
---|
567 | { |
---|
568 | AtkTableIface *iface; |
---|
569 | |
---|
570 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
571 | |
---|
572 | iface = ATK_TABLE_GET_IFACE (table); |
---|
573 | |
---|
574 | if (iface->is_column_selected) |
---|
575 | return (iface->is_column_selected) (table, column); |
---|
576 | else |
---|
577 | return FALSE; |
---|
578 | } |
---|
579 | |
---|
580 | /** |
---|
581 | * atk_table_is_row_selected: |
---|
582 | * @table: a GObject instance that implements AtkTableIface |
---|
583 | * @row: a #gint representing a row in @table |
---|
584 | * |
---|
585 | * Gets a boolean value indicating whether the specified @row |
---|
586 | * is selected |
---|
587 | * |
---|
588 | * Returns: a gboolean representing if the row is selected, or 0 |
---|
589 | * if value does not implement this interface. |
---|
590 | **/ |
---|
591 | gboolean |
---|
592 | atk_table_is_row_selected (AtkTable *table, |
---|
593 | gint row) |
---|
594 | { |
---|
595 | AtkTableIface *iface; |
---|
596 | |
---|
597 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
598 | |
---|
599 | iface = ATK_TABLE_GET_IFACE (table); |
---|
600 | |
---|
601 | if (iface->is_row_selected) |
---|
602 | return (iface->is_row_selected) (table, row); |
---|
603 | else |
---|
604 | return FALSE; |
---|
605 | } |
---|
606 | |
---|
607 | /** |
---|
608 | * atk_table_is_selected: |
---|
609 | * @table: a GObject instance that implements AtkTableIface |
---|
610 | * @row: a #gint representing a row in @table |
---|
611 | * @column: a #gint representing a column in @table |
---|
612 | * |
---|
613 | * Gets a boolean value indicating whether the accessible object |
---|
614 | * at the specified @row and @column is selected |
---|
615 | * |
---|
616 | * Returns: a gboolean representing if the cell is selected, or 0 |
---|
617 | * if value does not implement this interface. |
---|
618 | **/ |
---|
619 | gboolean |
---|
620 | atk_table_is_selected (AtkTable *table, |
---|
621 | gint row, |
---|
622 | gint column) |
---|
623 | { |
---|
624 | AtkTableIface *iface; |
---|
625 | |
---|
626 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
627 | |
---|
628 | iface = ATK_TABLE_GET_IFACE (table); |
---|
629 | |
---|
630 | if (iface->is_selected) |
---|
631 | return (iface->is_selected) (table, row, column); |
---|
632 | else |
---|
633 | return FALSE; |
---|
634 | } |
---|
635 | |
---|
636 | /** |
---|
637 | * atk_table_add_row_selection: |
---|
638 | * @table: a GObject instance that implements AtkTableIface |
---|
639 | * @row: a #gint representing a row in @table |
---|
640 | * |
---|
641 | * Adds the specified @row to the selection. |
---|
642 | * |
---|
643 | * Returns: a gboolean representing if row was successfully added to selection, |
---|
644 | * or 0 if value does not implement this interface. |
---|
645 | **/ |
---|
646 | gboolean |
---|
647 | atk_table_add_row_selection (AtkTable *table, |
---|
648 | gint row) |
---|
649 | { |
---|
650 | AtkTableIface *iface; |
---|
651 | |
---|
652 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
653 | |
---|
654 | iface = ATK_TABLE_GET_IFACE (table); |
---|
655 | |
---|
656 | if (iface->add_row_selection) |
---|
657 | return (iface->add_row_selection) (table, row); |
---|
658 | else |
---|
659 | return FALSE; |
---|
660 | } |
---|
661 | /** |
---|
662 | * atk_table_remove_row_selection: |
---|
663 | * @table: a GObject instance that implements AtkTableIface |
---|
664 | * @row: a #gint representing a row in @table |
---|
665 | * |
---|
666 | * Removes the specified @row from the selection. |
---|
667 | * |
---|
668 | * Returns: a gboolean representing if the row was successfully removed from |
---|
669 | * the selection, or 0 if value does not implement this interface. |
---|
670 | **/ |
---|
671 | gboolean |
---|
672 | atk_table_remove_row_selection (AtkTable *table, |
---|
673 | gint row) |
---|
674 | { |
---|
675 | AtkTableIface *iface; |
---|
676 | |
---|
677 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
678 | |
---|
679 | iface = ATK_TABLE_GET_IFACE (table); |
---|
680 | |
---|
681 | if (iface->remove_row_selection) |
---|
682 | return (iface->remove_row_selection) (table, row); |
---|
683 | else |
---|
684 | return FALSE; |
---|
685 | } |
---|
686 | /** |
---|
687 | * atk_table_add_column_selection: |
---|
688 | * @table: a GObject instance that implements AtkTableIface |
---|
689 | * @column: a #gint representing a column in @table |
---|
690 | * |
---|
691 | * Adds the specified @column to the selection. |
---|
692 | * |
---|
693 | * Returns: a gboolean representing if the column was successfully added to |
---|
694 | * the selection, or 0 if value does not implement this interface. |
---|
695 | **/ |
---|
696 | gboolean |
---|
697 | atk_table_add_column_selection (AtkTable *table, |
---|
698 | gint column) |
---|
699 | { |
---|
700 | AtkTableIface *iface; |
---|
701 | |
---|
702 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
703 | |
---|
704 | iface = ATK_TABLE_GET_IFACE (table); |
---|
705 | |
---|
706 | if (iface->add_column_selection) |
---|
707 | return (iface->add_column_selection) (table, column); |
---|
708 | else |
---|
709 | return FALSE; |
---|
710 | } |
---|
711 | /** |
---|
712 | * atk_table_remove_column_selection: |
---|
713 | * @table: a GObject instance that implements AtkTableIface |
---|
714 | * @column: a #gint representing a column in @table |
---|
715 | * |
---|
716 | * Adds the specified @column to the selection. |
---|
717 | * |
---|
718 | * Returns: a gboolean representing if the column was successfully removed from |
---|
719 | * the selection, or 0 if value does not implement this interface. |
---|
720 | **/ |
---|
721 | gboolean |
---|
722 | atk_table_remove_column_selection (AtkTable *table, |
---|
723 | gint column) |
---|
724 | { |
---|
725 | AtkTableIface *iface; |
---|
726 | |
---|
727 | g_return_val_if_fail (ATK_IS_TABLE (table), FALSE); |
---|
728 | |
---|
729 | iface = ATK_TABLE_GET_IFACE (table); |
---|
730 | |
---|
731 | if (iface->remove_column_selection) |
---|
732 | return (iface->remove_column_selection) (table, column); |
---|
733 | else |
---|
734 | return FALSE; |
---|
735 | } |
---|
736 | |
---|
737 | /** |
---|
738 | * atk_table_set_caption: |
---|
739 | * @table: a GObject instance that implements AtkTableIface |
---|
740 | * @caption: a #AtkObject representing the caption to set for @table |
---|
741 | * |
---|
742 | * Sets the caption for the table. |
---|
743 | **/ |
---|
744 | void |
---|
745 | atk_table_set_caption (AtkTable *table, |
---|
746 | AtkObject *caption) |
---|
747 | { |
---|
748 | AtkTableIface *iface; |
---|
749 | |
---|
750 | g_return_if_fail (ATK_IS_TABLE (table)); |
---|
751 | |
---|
752 | iface = ATK_TABLE_GET_IFACE (table); |
---|
753 | |
---|
754 | if (iface->set_caption) |
---|
755 | (iface->set_caption) (table, caption); |
---|
756 | } |
---|
757 | |
---|
758 | /** |
---|
759 | * atk_table_set_column_description: |
---|
760 | * @table: a GObject instance that implements AtkTableIface |
---|
761 | * @column: a #gint representing a column in @table |
---|
762 | * @description: a #gchar representing the description text |
---|
763 | * to set for the specified @column of the @table |
---|
764 | * |
---|
765 | * Sets the description text for the specified @column of the @table. |
---|
766 | **/ |
---|
767 | void |
---|
768 | atk_table_set_column_description (AtkTable *table, |
---|
769 | gint column, |
---|
770 | const gchar *description) |
---|
771 | { |
---|
772 | AtkTableIface *iface; |
---|
773 | |
---|
774 | g_return_if_fail (ATK_IS_TABLE (table)); |
---|
775 | |
---|
776 | iface = ATK_TABLE_GET_IFACE (table); |
---|
777 | |
---|
778 | if (iface->set_column_description) |
---|
779 | (iface->set_column_description) (table, column, description); |
---|
780 | } |
---|
781 | |
---|
782 | /** |
---|
783 | * atk_table_set_column_header: |
---|
784 | * @table: a GObject instance that implements AtkTableIface |
---|
785 | * @column: a #gint representing a column in @table |
---|
786 | * @header: an #AtkTable |
---|
787 | * |
---|
788 | * Sets the specified column header to @header. |
---|
789 | **/ |
---|
790 | void |
---|
791 | atk_table_set_column_header (AtkTable *table, |
---|
792 | gint column, |
---|
793 | AtkObject *header) |
---|
794 | { |
---|
795 | AtkTableIface *iface; |
---|
796 | |
---|
797 | g_return_if_fail (ATK_IS_TABLE (table)); |
---|
798 | |
---|
799 | iface = ATK_TABLE_GET_IFACE (table); |
---|
800 | |
---|
801 | if (iface->set_column_header) |
---|
802 | (iface->set_column_header) (table, column, header); |
---|
803 | } |
---|
804 | |
---|
805 | /** |
---|
806 | * atk_table_set_row_description: |
---|
807 | * @table: a GObject instance that implements AtkTableIface |
---|
808 | * @row: a #gint representing a row in @table |
---|
809 | * @description: a #gchar representing the description text |
---|
810 | * to set for the specified @row of @table |
---|
811 | * |
---|
812 | * Sets the description text for the specified @row of @table. |
---|
813 | **/ |
---|
814 | void |
---|
815 | atk_table_set_row_description (AtkTable *table, |
---|
816 | gint row, |
---|
817 | const gchar *description) |
---|
818 | { |
---|
819 | AtkTableIface *iface; |
---|
820 | |
---|
821 | g_return_if_fail (ATK_IS_TABLE (table)); |
---|
822 | |
---|
823 | iface = ATK_TABLE_GET_IFACE (table); |
---|
824 | |
---|
825 | if (iface->set_row_description) |
---|
826 | (iface->set_row_description) (table, row, description); |
---|
827 | } |
---|
828 | |
---|
829 | /** |
---|
830 | * atk_table_set_row_header: |
---|
831 | * @table: a GObject instance that implements AtkTableIface |
---|
832 | * @row: a #gint representing a row in @table |
---|
833 | * @header: an #AtkTable |
---|
834 | * |
---|
835 | * Sets the specified row header to @header. |
---|
836 | **/ |
---|
837 | void |
---|
838 | atk_table_set_row_header (AtkTable *table, |
---|
839 | gint row, |
---|
840 | AtkObject *header) |
---|
841 | { |
---|
842 | AtkTableIface *iface; |
---|
843 | |
---|
844 | g_return_if_fail (ATK_IS_TABLE (table)); |
---|
845 | |
---|
846 | iface = ATK_TABLE_GET_IFACE (table); |
---|
847 | |
---|
848 | if (iface->set_row_header) |
---|
849 | (iface->set_row_header) (table, row, header); |
---|
850 | } |
---|
851 | |
---|
852 | /** |
---|
853 | * atk_table_set_summary: |
---|
854 | * @table: a GObject instance that implements AtkTableIface |
---|
855 | * @accessible: an #AtkObject representing the summary description |
---|
856 | * to set for @table |
---|
857 | * |
---|
858 | * Sets the summary description of the table. |
---|
859 | **/ |
---|
860 | void |
---|
861 | atk_table_set_summary (AtkTable *table, |
---|
862 | AtkObject *accessible) |
---|
863 | { |
---|
864 | AtkTableIface *iface; |
---|
865 | |
---|
866 | g_return_if_fail (ATK_IS_TABLE (table)); |
---|
867 | |
---|
868 | iface = ATK_TABLE_GET_IFACE (table); |
---|
869 | |
---|
870 | if (iface->set_summary) |
---|
871 | (iface->set_summary) (table, accessible); |
---|
872 | } |
---|