Add AT-SPI mapping for ATK_RELATION_NODE_PARENT_OF
[platform/core/uifw/at-spi2-atk.git] / cspi / spi-table.c
1 /*
2  * AT-SPI - Assistive Technology Service Provider Interface
3  * (Gnome Accessibility Project; http://developer.gnome.org/projects/gap)
4  *
5  * Copyright 2001, 2002 Sun Microsystems Inc.,
6  * Copyright 2001, 2002 Ximian, Inc.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the
20  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21  * Boston, MA 02111-1307, USA.
22  */
23
24 #include <stdlib.h> /* for malloc */
25 #include <cspi/spi-private.h>
26
27 /**
28  * AccessibleTable_ref:
29  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
30  *
31  * Increment the reference count for an #AccessibleTable object.
32  **/
33 void
34 AccessibleTable_ref (AccessibleTable *obj)
35 {
36   cspi_object_ref (obj);
37 }
38
39 /**
40  * AccessibleTable_unref:
41  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
42  *
43  * Decrement the reference count for an #AccessibleTable object.
44  **/
45 void
46 AccessibleTable_unref (AccessibleTable *obj)
47 {
48   cspi_object_unref (obj);
49 }
50
51 /**
52  * AccessibleTable_getCaption:
53  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
54  *
55  * Get an accessible representation of the caption for an #AccessibleTable.
56  *
57  * Returns: an #Accessible object that serves as the table's caption.
58  **/
59 Accessible *
60 AccessibleTable_getCaption (AccessibleTable *obj)
61 {
62   char *path;
63   Accessible *retval;
64
65   cspi_return_val_if_fail (obj != NULL, NULL);
66
67   cspi_dbus_get_property (obj, spi_interface_table, "caption", NULL, "o", &path);
68   cspi_return_val_if_ev ("getCaption", NULL);
69   retval =  cspi_ref_related_accessible (obj, path);
70   g_free (path);
71   return retval;
72 }
73
74 /**
75  * AccessibleTable_getSummary:
76  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
77  *
78  * Get an accessible object which summarizes the contents of an #AccessibleTable.
79  *
80  * Returns: an #Accessible object that serves as the table's summary (often a
81  *          reduced #AccessibleTable).
82  **/
83 Accessible *
84 AccessibleTable_getSummary (AccessibleTable *obj)
85 {
86   char *path;
87   Accessible *retval;
88
89   cspi_return_val_if_fail (obj != NULL, NULL);
90
91   cspi_dbus_get_property (obj, spi_interface_table, "summary", NULL, "o", &path);
92   cspi_return_val_if_ev ("getSummary", NULL);
93   retval =  cspi_ref_related_accessible (obj, path);
94   g_free (path);
95  return retval;
96 }
97
98 /**
99  * AccessibleTable_getNRows:
100  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
101  *
102  * Get the number of rows in an #AccessibleTable,
103  *        exclusive of any rows that are programmatically hidden, but inclusive
104  *        of rows that may be outside of the current scrolling window or viewport.
105  *
106  * Returns: a #long integer indicating the number of rows in the table.
107  **/
108 long
109 AccessibleTable_getNRows (AccessibleTable *obj)
110 {
111   dbus_int32_t retval;
112
113   cspi_return_val_if_fail (obj != NULL, -1);
114
115   cspi_dbus_get_property (obj, spi_interface_table, "nRows", NULL, "i", &retval);
116           
117   cspi_return_val_if_ev ("getNRows", -1);
118
119   return retval;
120           
121 }
122
123 /**
124  * AccessibleTable_getNColumns:
125  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
126  *
127  * Get the number of columns in an #AccessibleTable,
128  *        exclusive of any columns that are programmatically hidden, but inclusive
129  *        of columns that may be outside of the current scrolling window or viewport.
130  *
131  * Returns: a #long integer indicating the number of columns in the table.
132  **/
133 long
134 AccessibleTable_getNColumns (AccessibleTable *obj)
135 {
136   dbus_int32_t retval;
137
138   cspi_return_val_if_fail (obj != NULL, -1);
139
140   cspi_dbus_get_property (obj, spi_interface_table, "nColumns", NULL, "i", &retval);
141           
142   cspi_return_val_if_ev ("getNColumns", -1);
143
144   return retval;
145 }
146
147 /**
148  * AccessibleTable_getAccessibleAt:
149  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
150  * @row: the specified table row, zero-indexed.
151  * @column: the specified table column, zero-indexed.
152  *
153  * Get the table cell at the specified row and column indices.
154  *          To get the accessible object at a particular (x, y) screen coordinate,
155  *          use #Accessible_getAccessibleAtPoint ().
156  *
157  * Returns: an #Accessible object representing the specified table cell.
158  **/
159 Accessible *
160 AccessibleTable_getAccessibleAt (AccessibleTable *obj,
161                                  long int row,
162                                  long int column)
163 {
164   dbus_int32_t d_row = row, d_column = column;
165   char *path;
166   Accessible *retval;
167
168   cspi_return_val_if_fail (obj != NULL, NULL);
169
170   cspi_dbus_call (obj, spi_interface_table, "getAccessibleAt", NULL, "ii=>o", &d_row, &d_column, &path);
171   cspi_return_val_if_ev ("getAccessibleAt", NULL);
172   retval = cspi_ref_related_accessible (obj, path);
173   g_free (path);
174  return retval;
175 }
176
177 /**
178  * AccessibleTable_getIndexAt:
179  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
180  * @row: the specified table row, zero-indexed.
181  * @column: the specified table column, zero-indexed.
182  *
183  * Get the 1-D child index corresponding to the specified 2-D row and column indices.
184  *          To get the accessible object at a particular (x, y) screen coordinate,
185  *          use #Accessible_getAccessibleAtPoint ().
186  * @see #AccessibleTable_getRowAtIndex(), #AccessibleTable_getColumnAtIndex()
187  *
188  * Returns: a long integer which serves as the index of a specified cell in the
189  *          table, in a form usable by #Accessible_getChildAtIndex().
190  **/
191 long
192 AccessibleTable_getIndexAt (AccessibleTable *obj,
193                             long int row,
194                             long int column)
195 {
196   dbus_int32_t d_row = row, d_column = column;
197   dbus_int32_t retval;
198
199   cspi_return_val_if_fail (obj != NULL, -1);
200
201   cspi_dbus_call (obj, spi_interface_table, "getIndexAt", NULL, "ii=>i", d_row, d_column, &retval);
202           
203   cspi_return_val_if_ev ("getIndexAt", -1);
204
205   return retval;
206 }
207
208 /**
209  * AccessibleTable_getRowAtIndex:
210  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
211  * @index: the specified child index, zero-indexed.
212  *
213  * Get the table row index occupied by the child at a particular 1-D child index.
214  *
215  * @see #AccessibleTable_getIndexAt(), #AccessibleTable_getColumnAtIndex()
216  *
217  * Returns: a long integer indicating the first row spanned by the child of a
218  *          table, at the specified 1-D (zero-offset) @index.
219  **/
220 long
221 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
222                                long index)
223 {
224   dbus_int32_t d_index = index;
225   dbus_int32_t retval;
226
227   cspi_return_val_if_fail (obj != NULL, -1);
228
229   cspi_dbus_call (obj, spi_interface_table, "getRowAtIndex", NULL, "i=>i", d_index, &retval);
230           
231   cspi_return_val_if_ev ("getRowAtIndex", -1);
232
233   return retval;
234 }
235
236 /**
237  * AccessibleTable_getColumnAtIndex:
238  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
239  * @index: the specified child index, zero-indexed.
240  *
241  * Get the table column index occupied by the child at a particular 1-D child index.
242  *
243  * @see #AccessibleTable_getIndexAt(), #AccessibleTable_getRowAtIndex()
244  *
245  * Returns: a long integer indicating the first column spanned by the child of a
246  *          table, at the specified 1-D (zero-offset) @index.
247  **/
248 long
249 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
250                                   long index)
251 {
252   dbus_int32_t d_index = index;
253   dbus_int32_t retval;
254
255   cspi_return_val_if_fail (obj != NULL, -1);
256
257   cspi_dbus_call (obj, spi_interface_table, "getColumnAtIndex", NULL, "i=>i", d_index, &retval);
258           
259   cspi_return_val_if_ev ("getColumnAtIndex", -1);
260
261   return retval;
262 }
263
264 /**
265  * AccessibleTable_getRowDescription:
266  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
267  * @row: the specified table row, zero-indexed.
268  *
269  * Get a text description of a particular table row.  This differs from
270  * AccessibleTable_getRowHeader, which returns an #Accessible.
271  *
272  * Returns: a UTF-8 string describing the specified table row, if available.
273  **/
274 char *
275 AccessibleTable_getRowDescription (AccessibleTable *obj,
276                                    long int         row)
277 {
278   dbus_int32_t d_row = row;
279   char *retval;
280
281   cspi_return_val_if_fail (obj != NULL, NULL);
282
283   cspi_dbus_call (obj, spi_interface_table, "getRowDescription", NULL, "i=>s", d_row, &retval);
284           
285   cspi_return_val_if_ev ("getRowDescription", NULL);
286
287   return retval;
288 }
289
290 /**
291  * AccessibleTable_getColumnDescription:
292  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
293  * @column: the specified table column, zero-indexed.
294  *
295  * Get a text description of a particular table column.  This differs from
296  * AccessibleTable_getColumnHeader, which returns an #Accessible.
297  *
298  * Returns: a UTF-8 string describing the specified table column, if available.
299  **/
300 char *
301 AccessibleTable_getColumnDescription (AccessibleTable *obj,
302                                       long int         column)
303 {
304   dbus_int32_t d_column = column;
305   char *retval;
306
307   cspi_return_val_if_fail (obj != NULL, NULL);
308
309   cspi_dbus_call (obj, spi_interface_table, "getColumnDescription", NULL, "i=>s", d_column, &retval);
310
311   cspi_return_val_if_ev ("getColumnDescription", NULL);
312
313   return retval;
314 }
315
316 /**
317  * AccessibleTable_getRowExtentAt:
318  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
319  * @row: the specified table row, zero-indexed.
320  * @column: the specified table column, zero-indexed.
321  *
322  * Get the number of rows spanned by the table cell at the specific row and column.
323  * (some tables can have cells which span multiple rows and/or columns).
324  *
325  * Returns: a long integer indicating the number of rows spanned by the specified cell.
326  **/
327 long
328 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
329                                 long int         row,
330                                 long int         column)
331 {
332   dbus_int32_t d_row = row, d_column = column;
333   dbus_int32_t retval;
334
335   cspi_return_val_if_fail (obj != NULL, -1);
336
337   cspi_dbus_call (obj, spi_interface_table, "getRowExtentAt", NULL, "ii=>i", d_row, d_column, &retval);
338           
339   cspi_return_val_if_ev ("getRowExtentAt", -1);
340
341   return retval;
342 }
343
344 /**
345  * AccessibleTable_getColumnExtentAt:
346  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
347  * @row: the specified table row, zero-indexed.
348  * @column: the specified table column, zero-indexed.
349  *
350  * Get the number of columns spanned by the table cell at the specific row and column.
351  * (some tables can have cells which span multiple rows and/or columns).
352  *
353  * Returns: a long integer indicating the number of columns spanned by the specified cell.
354  **/
355 long
356 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
357                                    long int         row,
358                                    long int         column)
359 {
360   dbus_int32_t d_row = row, d_column = column;
361   dbus_int32_t retval;
362
363   cspi_return_val_if_fail (obj != NULL, -1);
364
365   cspi_dbus_call (obj, spi_interface_table, "getColumnExtentAt", NULL, "ii=>i", d_row, d_column, &retval);
366           
367   cspi_return_val_if_ev ("getColumnExtentAt", -1);
368
369   return retval;
370 }
371
372 /**
373  * AccessibleTable_getRowHeader:
374  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
375  * @row: the specified table row, zero-indexed.
376  *
377  * Get the header associated with a table row, if available.  This differs from
378  * AccessibleTable_getRowDescription, which returns a string.
379  *
380  * Returns: a #Accessible representatin of the specified table row, if available.
381  **/
382 Accessible *
383 AccessibleTable_getRowHeader (AccessibleTable *obj,
384                               long int         row)
385 {
386   dbus_int32_t d_row = row;
387   char *path;
388   Accessible *retval;
389
390   cspi_return_val_if_fail (obj != NULL, NULL);
391
392   cspi_dbus_call (obj, spi_interface_table, "getRowHeader", NULL, "i=>o", d_row, &path);
393   cspi_return_val_if_ev ("getRowHeader", NULL);
394   retval = cspi_ref_related_accessible (obj, path);
395   g_free (path);
396
397  return retval;
398 }
399
400 /**
401  * AccessibleTable_getColumnHeader:
402  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
403  * @column: the specified table column, zero-indexed.
404  *
405  * Get the header associated with a table column, if available.  This differs from
406  * AccessibleTable_getColumnDescription, which returns a string.
407  *
408  * Returns: a #Accessible representatin of the specified table column, if available.
409  **/
410 Accessible *
411 AccessibleTable_getColumnHeader (AccessibleTable *obj,
412                                  long int column)
413 {
414   dbus_int32_t d_column = column;
415   char *path;
416   Accessible *retval;
417
418   cspi_return_val_if_fail (obj != NULL, NULL);
419
420   cspi_dbus_call (obj, spi_interface_table, "getColumnHeader", NULL, "i=>o", d_column, &path);
421   cspi_return_val_if_ev ("getColumnHeader", NULL);
422   retval = cspi_ref_related_accessible (obj, path);
423   g_free (path);
424
425   return retval;
426 }
427
428 /**
429  * AccessibleTable_getNSelectedRows:
430  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
431  *
432  * Query a table to find out how many rows are currently selected.  Not all tables
433  *  support row selection.
434  *
435  * Returns: a long integer indicating the number of rows currently selected.
436  **/
437 long
438 AccessibleTable_getNSelectedRows (AccessibleTable *obj)
439 {
440   dbus_int32_t retval;
441
442   cspi_return_val_if_fail (obj != NULL, -1);
443
444   cspi_dbus_get_property (obj, spi_interface_table, "nSelectedRows", NULL, "i", &retval);
445           
446   cspi_return_val_if_ev ("getNSelectedRows", -1);
447
448   return retval;
449 }
450
451 static long
452 cspi_long_seq_to_array (GArray *seq, long int **array)
453 {
454   long *j;
455   long length, i;
456
457   if (!cspi_check_ev ("getSelectionItems"))
458     {
459       *array = NULL;
460       return 0;
461     }
462
463   length = seq->len;
464
465   j = *array = malloc (sizeof (long) * length);
466
467   for (i = 0; i < length; i++)
468     {
469       j[i] = g_array_index (seq, long, i);
470     }
471
472   g_array_free (seq, TRUE);
473
474   return length;
475 }
476
477 /**
478  * AccessibleTable_getSelectedRows:
479  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
480  * @selectedRows: a doubly indirected pointer which will be set to the address
481  *       of an array of long integers, specifying which rows are currently selected.
482  *
483  * Query a table for a list of indices of rows which are currently selected.
484  *
485  * Returns: a long integer indicating the length of the array returned in @selectedRows.
486  **/
487 long
488 AccessibleTable_getSelectedRows (AccessibleTable *obj,
489                                  long int       **selectedRows)
490 {
491   GArray *rows;
492
493   *selectedRows = NULL;
494
495   cspi_return_val_if_fail (obj != NULL, 0);
496
497   cspi_dbus_call (obj, spi_interface_table, "getSelectedRows", NULL, "=>ai", &rows);
498
499   cspi_return_val_if_ev ("getSelectedRows", -1);
500
501   return cspi_long_seq_to_array (rows, selectedRows);
502 }
503
504 /**
505  * AccessibleTable_getNSelectedColumns:
506  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
507  *
508  * Query a table to find out how many columns are currently selected.  Not all tables
509  *  support column selection.
510  *
511  * Returns: a long integer indicating the number of columns currently selected.
512  **/
513 long
514 AccessibleTable_getNSelectedColumns (AccessibleTable *obj)
515 {
516   dbus_int32_t retval;
517
518   cspi_return_val_if_fail (obj != NULL, -1);
519
520   cspi_dbus_get_property (obj, spi_interface_table, "nSelectedColumns", NULL, "i", &retval);
521           
522   cspi_return_val_if_ev ("getNSelectedColumns", -1);
523
524   return retval;
525 }
526
527 /**
528  * AccessibleTable_getSelectedColumns:
529  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
530  * @selectedColumns: a doubly indirected pointer which will be set to the address
531  *       of an array of long integers, specifying which columns are currently selected.
532  *
533  * Query a table for a list of indices of columns which are currently selected.
534  *       Not all tables support column selection.
535  *
536  * Returns: a long integer indicating the length of the array returned in @selectedColumns.
537  **/
538 long
539 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
540                                     long int       **selectedColumns)
541 {
542   GArray *columns;
543
544   *selectedColumns = NULL;
545
546   cspi_return_val_if_fail (obj != NULL, 0);
547
548   cspi_dbus_call (obj, spi_interface_table, "getSelectedColumns", NULL, "=>ai", &columns);
549
550   cspi_return_val_if_ev ("getSelectedColumns", -1);
551   return cspi_long_seq_to_array (columns, selectedColumns);
552 }
553
554 /**
555  * AccessibleTable_isRowSelected:
556  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
557  * @row: the zero-indexed row number of the row being queried.
558  *
559  * Determine whether a table row is selected.  Not all tables support row selection.
560  *
561  * Returns: #TRUE if the specified row is currently selected, #FALSE if not.
562  **/
563 SPIBoolean
564 AccessibleTable_isRowSelected (AccessibleTable *obj,
565                                long int         row)
566 {
567   dbus_int32_t d_row = row;
568   dbus_bool_t retval;
569
570   cspi_return_val_if_fail (obj != NULL, FALSE);
571
572   cspi_dbus_call (obj, spi_interface_table, "isRowSelected", NULL, "i=>b", d_row, &retval);
573
574   cspi_return_val_if_ev ("isRowSelected", FALSE);
575
576   return retval;
577 }
578
579 /**
580  * AccessibleTable_isColumnSelected:
581  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
582  * @column: the zero-indexed column number of the column being queried.
583  *
584  * Determine whether specified table column is selected.
585  * Not all tables support column selection.
586  *
587  * Returns: #TRUE if the specified column is currently selected, #FALSE if not.
588  **/
589 SPIBoolean
590 AccessibleTable_isColumnSelected (AccessibleTable *obj,
591                                   long int         column)
592 {
593   dbus_int32_t d_column = column;
594   dbus_bool_t retval;
595
596   cspi_return_val_if_fail (obj != NULL, FALSE);
597
598   cspi_dbus_call (obj, spi_interface_table, "isColumnSelected", NULL, "i=>b", d_column, &retval);
599           
600   cspi_return_val_if_ev ("isColumnSelected", FALSE);
601
602   return retval;
603 }
604
605 /**
606  * AccessibleTable_addRowSelection:
607  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
608  * @row: the zero-indexed row number of the row being selected.
609  *
610  * Select the specified row, adding it to the current row selection.
611  * Not all tables support row selection.
612  *
613  * Returns: #TRUE if the specified row was successfully selected, #FALSE if not.
614  **/
615 SPIBoolean
616 AccessibleTable_addRowSelection (AccessibleTable *obj,
617                                  long int         row)
618 {
619   dbus_int32_t d_row = row;
620   dbus_bool_t retval;
621
622   cspi_return_val_if_fail (obj != NULL, FALSE);
623
624   cspi_dbus_call (obj, spi_interface_table, "addRowSelection", NULL, "i=>b", d_row, &retval);
625           
626   cspi_return_val_if_ev ("addRowSelection", FALSE);
627
628   return retval;
629 }
630
631 /**
632  * AccessibleTable_addColumnSelection:
633  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
634  * @column: the zero-indexed column number of the column being selected.
635  *
636  * Select the specified column, adding it to the current column selection.
637  * Not all tables support column selection.
638  *
639  * Returns: #TRUE if the specified column was successfully selected, #FALSE if not.
640  **/
641 SPIBoolean
642 AccessibleTable_addColumnSelection (AccessibleTable *obj,
643                                     long int         column)
644 {
645   dbus_int32_t d_column = column;
646   dbus_bool_t retval;
647
648   cspi_return_val_if_fail (obj != NULL, FALSE);
649
650   cspi_dbus_call (obj, spi_interface_table, "addColumnSelection", NULL, "i=>b", d_column, &retval);
651           
652   cspi_return_val_if_ev ("addColumnSelection", FALSE);
653
654   return retval;
655 }
656
657 /**
658  * AccessibleTable_removeRowSelection:
659  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
660  * @row: the zero-indexed number of the row being deselected.
661  *
662  * De-select the specified row, removing it to the current row selection.
663  * Not all tables support row selection.
664  *
665  * Returns: #TRUE if the specified row was successfully de-selected, #FALSE if not.
666  **/
667 SPIBoolean
668 AccessibleTable_removeRowSelection (AccessibleTable *obj,
669                                     long int         row)
670 {
671   dbus_int32_t d_row = row;
672   dbus_bool_t retval;
673
674   cspi_return_val_if_fail (obj != NULL, FALSE);
675
676   cspi_dbus_call (obj, spi_interface_table, "removeRowSelection", NULL, "i=>b", d_row, &retval);
677           
678   cspi_return_val_if_ev ("removeRowSelection", FALSE);
679
680   return retval;
681 }
682
683 /**
684  * AccessibleTable_removeColumnSelection:
685  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
686  * @column: the zero-indexed column number of the column being de-selected.
687  *
688  * De-select the specified column, removing it to the current column selection.
689  * Not all tables support column selection.
690  *
691  * Returns: #TRUE if the specified column was successfully de-selected, #FALSE if not.
692  **/
693 SPIBoolean
694 AccessibleTable_removeColumnSelection (AccessibleTable *obj,
695                                        long int         column)
696 {
697   dbus_int32_t d_column = column;
698   dbus_bool_t retval;
699
700   cspi_return_val_if_fail (obj != NULL, FALSE);
701
702   cspi_dbus_call (obj, spi_interface_table, "removeColumnSelection", NULL, "i=>b", d_column, &retval);
703           
704   cspi_return_val_if_ev ("removeColumnSelection", FALSE);
705
706   return retval;
707 }
708
709 /**
710  * AccessibleTable_getRowColumnExtentsAtIndex:
711  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
712  * @index: the index of the Table child whose row/column 
713  * extents are requested.
714  * @row: back-filled with the first table row associated with
715  * the cell with child index \c index.
716  * @col: back-filled with the first table column associated 
717  * with the cell with child index \c index.
718  * @row_extents: back-filled with the number of table rows 
719  * across which child \c i extends.
720  * @col_extents: back-filled with the number of table columns
721  * across which child \c i extends.
722  * @is_selected: a boolean which is back-filled with \c True
723  * if the child at index \c i corresponds to a selected table cell,
724  * \c False otherwise.
725  *
726  * Given a child index, determine the row and column indices and 
727  * extents, and whether the cell is currently selected.  If
728  * the child at \c index is not a cell (for instance, if it is 
729  * a summary, caption, etc.), \c False is returned.
730  *
731  * Example:
732  * If the Table child at index '6' extends across columns 5 and 6 of
733  * row 2 of a Table instance, and is currently selected, then
734  * 
735  * retval = table::getRowColumnExtentsAtIndex (6, row, col, 
736  *                                             row_extents,
737  *                                             col_extents,
738  *                                             is_selected);
739  * 
740  * will return True, and after the call
741  * row, col, row_extents, col_extents,
742  * and \c is_selected will contain 2, 5, 1, 2, and 
743  * True, respectively.
744  *
745  * Returns: \c True if the index is associated with a valid table
746  * cell, \c False if the index does not correspond to a cell.  If 
747  * \c False is returned, the values of the out parameters are 
748  * undefined.
749  * 
750  * Since AT-SPI 1.7.0
751  **/
752 SPIBoolean
753 AccessibleTable_getRowColumnExtentsAtIndex (AccessibleTable *obj,
754                                             long int index, long int *row, long int *col, 
755                                             long int *row_extents, long int *col_extents, 
756                                             long int *is_selected)
757 {
758   dbus_int32_t d_index = index;
759   dbus_bool_t retval;
760   dbus_int32_t d_row,  d_col, d_row_extents, d_col_extents; 
761   dbus_bool_t d_is_selected;
762
763   cspi_return_val_if_fail (obj != NULL, FALSE);
764
765   cspi_dbus_call (obj, spi_interface_table, "getRowColumnExtentsAtIndex", NULL, "i=>iiiibb", d_index, &d_row, &d_col, &d_row_extents, &d_col_extents, &d_is_selected, &retval);
766
767   if (!cspi_check_ev ("getRowColumnExtentsAtIndex")){
768     
769     *row = 0;
770     *col = 0;
771     *row_extents = 0;
772     *col_extents = 0;
773     *is_selected = FALSE;
774     retval = FALSE;
775   }
776
777   else {
778     *row = d_row;
779     *col = d_col;
780     *row_extents = d_row_extents;;
781     *col_extents = d_col_extents;
782     *is_selected = d_is_selected;;
783   }
784   
785   return retval;
786 }
787
788
789 /**
790  * AccessibleTable_isSelected:
791  * @obj: a pointer to the #AccessibleTable implementor on which to operate.
792  * @row: the zero-indexed row of the cell being queried.
793  * @column: the zero-indexed column of the cell being queried.
794  *
795  * Determine whether the cell at a specific row and column is selected.
796  *
797  * Returns: #TRUE if the specified cell is currently selected, #FALSE if not.
798  **/
799 SPIBoolean
800 AccessibleTable_isSelected (AccessibleTable *obj,
801                             long int row,
802                             long int column)
803 {
804   dbus_int32_t d_row = row, d_column = column;
805   dbus_bool_t retval;
806
807   cspi_return_val_if_fail (obj != NULL, FALSE);
808
809   cspi_dbus_call (obj, spi_interface_table, "isSelected", NULL, "ii=>b", d_row, d_column, &retval);
810           
811   cspi_return_val_if_ev ("isSelected", FALSE);
812
813   return retval;
814 }
815