1 #include <stdlib.h> /* for malloc */
2 #include <cspi/spi-private.h>
6 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
8 * Increment the reference count for an #AccessibleTable object.
11 AccessibleTable_ref (AccessibleTable *obj)
13 cspi_object_ref (obj);
17 * AccessibleTable_unref:
18 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
20 * Decrement the reference count for an #AccessibleTable object.
23 AccessibleTable_unref (AccessibleTable *obj)
25 cspi_object_unref (obj);
29 * AccessibleTable_getCaption:
30 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
32 * Get an accessible representation of the caption for an #AccessibleTable.
34 * Returns: an #Accessible object that serves as the table's caption.
37 AccessibleTable_getCaption (AccessibleTable *obj)
39 return cspi_object_add (
40 Accessibility_Table__get_caption (CSPI_OBJREF (obj), cspi_ev ()));
44 * AccessibleTable_getSummary:
45 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
47 * Get an accessible object which summarizes the contents of an #AccessibleTable.
49 * Returns: an #Accessible object that serves as the table's summary (often a
50 * reduced #AccessibleTable).
53 AccessibleTable_getSummary (AccessibleTable *obj)
55 return cspi_object_add (
56 Accessibility_Table__get_summary (CSPI_OBJREF (obj), cspi_ev ()));
60 * AccessibleTable_getNRows:
61 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
63 * Get the number of rows in an #AccessibleTable,
64 * exclusive of any rows that are programmatically hidden, but inclusive
65 * of rows that may be outside of the current scrolling window or viewport.
67 * Returns: a #long integer indicating the number of rows in the table.
70 AccessibleTable_getNRows (AccessibleTable *obj)
74 cspi_return_val_if_fail (obj != NULL, -1);
77 Accessibility_Table__get_nRows (CSPI_OBJREF (obj), cspi_ev ());
79 cspi_return_val_if_ev ("getNRows", -1);
86 * AccessibleTable_getNColumns:
87 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
89 * Get the number of columns in an #AccessibleTable,
90 * exclusive of any columns that are programmatically hidden, but inclusive
91 * of columns that may be outside of the current scrolling window or viewport.
93 * Returns: a #long integer indicating the number of columns in the table.
96 AccessibleTable_getNColumns (AccessibleTable *obj)
100 cspi_return_val_if_fail (obj != NULL, -1);
103 Accessibility_Table__get_nColumns (CSPI_OBJREF (obj), cspi_ev ());
105 cspi_return_val_if_ev ("", -1);
111 * AccessibleTable_getAccessibleAt:
112 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
113 * @row: the specified table row, zero-indexed.
114 * @column: the specified table column, zero-indexed.
116 * Get the table cell at the specified row and column indices.
117 * To get the accessible object at a particular (x, y) screen coordinate,
118 * use #Accessible_getAccessibleAtPoint ().
120 * Returns: an #Accessible object representing the specified table cell.
123 AccessibleTable_getAccessibleAt (AccessibleTable *obj,
127 return cspi_object_add (
128 Accessibility_Table_getAccessibleAt (
129 CSPI_OBJREF (obj), (CORBA_long) row,
130 (CORBA_long) column, cspi_ev ()));
134 * AccessibleTable_getIndexAt:
135 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
136 * @row: the specified table row, zero-indexed.
137 * @column: the specified table column, zero-indexed.
139 * Get the 1-D child index corresponding to the specified 2-D row and column indices.
140 * To get the accessible object at a particular (x, y) screen coordinate,
141 * use #Accessible_getAccessibleAtPoint ().
142 * @see #AccessibleTable_getRowAtIndex(), #AccessibleTable_getColumnAtIndex()
144 * Returns: a long integer which serves as the index of a specified cell in the
145 * table, in a form usable by #Accessible_getChildAtIndex().
148 AccessibleTable_getIndexAt (AccessibleTable *obj,
154 cspi_return_val_if_fail (obj != NULL, -1);
157 Accessibility_Table_getIndexAt (
158 CSPI_OBJREF (obj), (CORBA_long) row,
159 (CORBA_long) column, cspi_ev ());
161 cspi_return_val_if_ev ("getIndexAt", -1);
167 * AccessibleTable_getRowAtIndex:
168 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
169 * @index: the specified child index, zero-indexed.
171 * Get the table row index occupied by the child at a particular 1-D child index.
173 * @see #AccessibleTable_getIndexAt(), #AccessibleTable_getColumnAtIndex()
175 * Returns: a long integer indicating the first row spanned by the child of a
176 * table, at the specified 1-D (zero-offset) @index.
179 AccessibleTable_getRowAtIndex (AccessibleTable *obj,
184 cspi_return_val_if_fail (obj != NULL, -1);
187 Accessibility_Table_getRowAtIndex (CSPI_OBJREF (obj),
188 (CORBA_long) index, cspi_ev ());
190 cspi_return_val_if_ev ("", -1);
196 * AccessibleTable_getColumnAtIndex:
197 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
198 * @index: the specified child index, zero-indexed.
200 * Get the table column index occupied by the child at a particular 1-D child index.
202 * @see #AccessibleTable_getIndexAt(), #AccessibleTable_getRowAtIndex()
204 * Returns: a long integer indicating the first column spanned by the child of a
205 * table, at the specified 1-D (zero-offset) @index.
208 AccessibleTable_getColumnAtIndex (AccessibleTable *obj,
213 cspi_return_val_if_fail (obj != NULL, -1);
216 Accessibility_Table_getColumnAtIndex (CSPI_OBJREF (obj),
217 (CORBA_long) index, cspi_ev ());
219 cspi_return_val_if_ev ("getColumnAtIndex", -1);
225 * AccessibleTable_getRowDescription:
226 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
227 * @row: the specified table row, zero-indexed.
229 * Get a text description of a particular table row. This differs from
230 * AccessibleTable_getRowHeader, which returns an #Accessible.
232 * Returns: a UTF-8 string describing the specified table row, if available.
235 AccessibleTable_getRowDescription (AccessibleTable *obj,
240 cspi_return_val_if_fail (obj != NULL, NULL);
243 Accessibility_Table_getRowDescription (CSPI_OBJREF (obj),
244 (CORBA_long) row, cspi_ev ());
246 cspi_return_val_if_ev ("getRowDescription", NULL);
252 * AccessibleTable_getColumnDescription:
253 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
254 * @column: the specified table column, zero-indexed.
256 * Get a text description of a particular table column. This differs from
257 * AccessibleTable_getColumnHeader, which returns an #Accessible.
259 * Returns: a UTF-8 string describing the specified table column, if available.
262 AccessibleTable_getColumnDescription (AccessibleTable *obj,
267 cspi_return_val_if_fail (obj != NULL, NULL);
270 Accessibility_Table_getColumnDescription (CSPI_OBJREF (obj),
271 (CORBA_long) column, cspi_ev ());
273 cspi_return_val_if_ev ("getColumnDescription", NULL);
279 * AccessibleTable_getRowExtentAt:
280 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
281 * @row: the specified table row, zero-indexed.
282 * @column: the specified table column, zero-indexed.
284 * Get the number of rows spanned by the table cell at the specific row and column.
285 * (some tables can have cells which span multiple rows and/or columns).
287 * Returns: a long integer indicating the number of rows spanned by the specified cell.
290 AccessibleTable_getRowExtentAt (AccessibleTable *obj,
296 cspi_return_val_if_fail (obj != NULL, -1);
299 Accessibility_Table_getRowExtentAt (
300 CSPI_OBJREF (obj), (CORBA_long) row,
301 (CORBA_long) column, cspi_ev ());
303 cspi_return_val_if_ev ("getRowExtentAt", -1);
309 * AccessibleTable_getColumnExtentAt:
310 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
311 * @row: the specified table row, zero-indexed.
312 * @column: the specified table column, zero-indexed.
314 * Get the number of columns spanned by the table cell at the specific row and column.
315 * (some tables can have cells which span multiple rows and/or columns).
317 * Returns: a long integer indicating the number of columns spanned by the specified cell.
320 AccessibleTable_getColumnExtentAt (AccessibleTable *obj,
326 cspi_return_val_if_fail (obj != NULL, -1);
329 Accessibility_Table_getColumnExtentAt (
330 CSPI_OBJREF (obj), (CORBA_long) row,
331 (CORBA_long) column, cspi_ev ());
333 cspi_return_val_if_ev ("getColumnExtentAt", -1);
339 * AccessibleTable_getRowHeader:
340 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
341 * @row: the specified table row, zero-indexed.
343 * Get the header associated with a table row, if available. This differs from
344 * AccessibleTable_getRowDescription, which returns a string.
346 * Returns: a #Accessible representatin of the specified table row, if available.
349 AccessibleTable_getRowHeader (AccessibleTable *obj,
352 return cspi_object_add (
353 Accessibility_Table_getRowHeader (CSPI_OBJREF (obj),
354 (CORBA_long) row, cspi_ev ()));
358 * AccessibleTable_getColumnHeader:
359 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
360 * @column: the specified table column, zero-indexed.
362 * Get the header associated with a table column, if available. This differs from
363 * AccessibleTable_getColumnDescription, which returns a string.
365 * Returns: a #Accessible representatin of the specified table column, if available.
368 AccessibleTable_getColumnHeader (AccessibleTable *obj,
371 return cspi_object_add (
372 Accessibility_Table_getColumnHeader (CSPI_OBJREF (obj),
373 (CORBA_long) column, cspi_ev ()));
377 * AccessibleTable_getNSelectedRows:
378 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
380 * Query a table to find out how many rows are currently selected. Not all tables
381 * support row selection.
383 * Returns: a long integer indicating the number of rows currently selected.
386 AccessibleTable_getNSelectedRows (AccessibleTable *obj)
390 cspi_return_val_if_fail (obj != NULL, -1);
393 Accessibility_Table__get_nSelectedRows (CSPI_OBJREF (obj), cspi_ev ());
395 cspi_return_val_if_ev ("getNSelectedRows", -1);
401 long_seq_to_array (Accessibility_LongSeq *seq, long int **array)
405 if (!cspi_check_ev ("getSelectionItems"))
411 length = seq->_length;
413 j = *array = malloc (sizeof (long) * length);
415 for (i = 0; i < length; i++)
417 j[i] = seq->_buffer [i];
426 * AccessibleTable_getSelectedRows:
427 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
428 * @selectedRows: a doubly indirected pointer which will be set to the address
429 * of an array of long integers, specifying which rows are currently selected.
431 * Query a table for a list of indices of rows which are currently selected.
433 * Returns: a long integer indicating the length of the array returned in @selectedRows.
436 AccessibleTable_getSelectedRows (AccessibleTable *obj,
437 long int **selectedRows)
439 Accessibility_LongSeq *rows;
441 *selectedRows = NULL;
443 cspi_return_val_if_fail (obj != NULL, 0);
445 rows = Accessibility_Table_getSelectedRows (CSPI_OBJREF (obj), cspi_ev ());
447 return long_seq_to_array (rows, selectedRows);
451 * AccessibleTable_getNSelectedColumns:
452 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
454 * Query a table to find out how many columnss are currently selected. Not all tables
455 * support column selection.
457 * Returns: a long integer indicating the number of columns currently selected.
460 AccessibleTable_getNSelectedColumns (AccessibleTable *obj)
464 cspi_return_val_if_fail (obj != NULL, -1);
467 Accessibility_Table__get_nSelectedColumns (CSPI_OBJREF (obj), cspi_ev ());
469 cspi_return_val_if_ev ("getNSelectedColumns", -1);
475 * AccessibleTable_getSelectedColumns:
476 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
477 * @selectedColumns: a doubly indirected pointer which will be set to the address
478 * of an array of long integers, specifying which columns are currently selected.
480 * Query a table for a list of indices of columns which are currently selected.
481 * Not all tables support column selection.
483 * Returns: a long integer indicating the length of the array returned in @selectedColumns.
486 AccessibleTable_getSelectedColumns (AccessibleTable *obj,
487 long int **selectedColumns)
489 Accessibility_LongSeq *columns;
491 *selectedColumns = NULL;
493 cspi_return_val_if_fail (obj != NULL, 0);
495 columns = Accessibility_Table_getSelectedColumns (CSPI_OBJREF (obj), cspi_ev ());
497 return long_seq_to_array (columns, selectedColumns);
501 * AccessibleTable_isRowSelected:
502 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
505 * Determine whether a table row is selected. Not all tables support row selection.
507 * Returns: #TRUE if the specified row is currently selected, #FALSE if not.
510 AccessibleTable_isRowSelected (AccessibleTable *obj,
515 cspi_return_val_if_fail (obj != NULL, FALSE);
518 Accessibility_Table_isRowSelected (CSPI_OBJREF (obj),
519 (CORBA_long) row, cspi_ev ());
521 cspi_return_val_if_ev ("isRowSelected", FALSE);
527 * AccessibleTable_isColumnSelected:
528 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
531 * Determine whether specified table column is selected.
532 * Not all tables support column selection.
534 * Returns: #TRUE if the specified column is currently selected, #FALSE if not.
537 AccessibleTable_isColumnSelected (AccessibleTable *obj,
542 cspi_return_val_if_fail (obj != NULL, FALSE);
545 Accessibility_Table_isColumnSelected (CSPI_OBJREF (obj),
546 (CORBA_long) column, cspi_ev ());
548 cspi_return_val_if_ev ("isColumnSelected", FALSE);
554 * AccessibleTable_isSelected:
555 * @obj: a pointer to the #AccessibleTable implementor on which to operate.
559 * Determine whether the cell at a specific row and column is selected.
561 * Returns: #TRUE if the specified cell is currently selected, #FALSE if not.
564 AccessibleTable_isSelected (AccessibleTable *obj,
570 cspi_return_val_if_fail (obj != NULL, FALSE);
573 Accessibility_Table_isSelected (CSPI_OBJREF (obj),
575 (CORBA_long) column, cspi_ev ());
577 cspi_return_val_if_ev ("isSelected", FALSE);