# Accessibility::Table Interface Reference

`import "Accessibility_Table.idl";`

## Public Member Functions

Accessible | getAccessibleAt (in long row, in long column)
long | getIndexAt (in long row, in long column)
long | getRowAtIndex (in long index)
long | getColumnAtIndex (in long index)
string | getRowDescription (in long row)
string | getColumnDescription (in long column)
long | getRowExtentAt (in long row, in long column)
long | getColumnExtentAt (in long row, in long column)
Accessible | getRowHeader (in long row)
Accessible | getColumnHeader (in long column)
LongSeq | getSelectedRows ()
LongSeq | getSelectedColumns ()
boolean | isRowSelected (in long row)
boolean | isColumnSelected (in long column)
boolean | isSelected (in long row, in long column)
boolean | addRowSelection (in long row)
boolean | addColumnSelection (in long column)
boolean | removeRowSelection (in long row)
boolean | removeColumnSelection (in long column)
boolean | getRowColumnExtentsAtIndex (in long index, out long row, out long col, out long row_extents, out long col_extents, out boolean is_selected)

## Data Fields

readonly attribute long | nRows
readonly attribute long | nColumns
readonly attribute Accessible | caption
readonly attribute Accessible | summary
readonly attribute long | nSelectedRows
readonly attribute long | nSelectedColumns

## Detailed Description

An interface used by containers whose contained data is arranged in a "tabular" (i.e. row-column) fashion. Tables may resemble a two-dimensional grid, as in a spreadsheet, or may feature objects which span multiple rows and/or columns, but whose bounds are aligned on a row/column matrix. Thus, the Table interface may be used to represent "spreadsheets" as well as "frames".

Objects within tables are children of the Table instance, and they may be referenced either via a child index or via a row/column pair. Their role may be ROLE_TABLE_CELL, but table 'cells' may have other roles as well. These 'cells' may implement other interfaces, such as Text, Action, Image, and Component, and should do so as appropriate to their onscreen representation and/or behavior.

## Member Function Documentation

boolean Accessibility::Table::addColumnSelection | ( | in long | column | ) |

Select the specified column, adding it to the current column selection, if the table's selection model permits it.

Parameters:

  | column |

Note:
  Possible reasons for addColumnSelection to return `False` include:
  - The table does not support Selection
  - The table column includes cells which do not have STATE_SELECTABLE
  - The table does not support selection by column
  - The table does not support selection of multiple columns, and one column is already selected.
  - The table does not support non-contiguous selections (i.e. does not include STATE_MULTISELECTABLE), and the specified column would result in selection of non-contiguous columns.
  - The table does not support user-instigated selection.

Returns:
  `True` if the specified column was successfully selected, `False` if not.

boolean Accessibility::Table::addRowSelection | ( | in long | row | ) |

Select the specified row, adding it to the current row selection, if the table's selection model permits it.

Parameters:

  | row |

Note:
  Possible reasons for addRowSelection to return `False` include:
  - The table does not support Selection
  - The table row includes cells which do not have STATE_SELECTABLE
  - The table does not support selection by row
  - The table does not support selection of multiple rows, and one row is already selected.
  - The table does not support non-contiguous selections (i.e. does not include STATE_MULTISELECTABLE), and the specified row would result in selection of non-contiguous rows.
  - The table does not support user-instigated selection.

Returns:
  `True` if the specified row was successfully selected, `False` if not.

Accessible Accessibility::Table::getAccessibleAt | ( | in long | row,
|  | in long | column |
| ) |  |  |

Get the table cell at the specified row and column indices.

Note:
  To get the accessible object at a particular (x, y) screen coordinate, use Accessible::getAccessibleAtPoint ().

Parameters:

  | row,: | the specified table row, zero-indexed.
  | column,: | the specified table column, zero-indexed.

Returns:
  an Accessible object representing the specified table cell.

long Accessibility::Table::getColumnAtIndex | ( | in long | index | ) |

Get the table column index occupied by the child at a particular 1-D child index.

Parameters:

  | index,: | the specified child index, zero-indexed.

See also:
  getIndexAt(), getRowAtIndex()

Returns:
  a long integer indicating the first column spanned by the child of a table, at the specified 1-D (zero-offset) `index`.

string Accessibility::Table::getColumnDescription | ( | in long | column | ) |

Get a text description of a particular table column. This differs from AccessibleTable_getColumnHeader, which returns an Accessible.

Parameters:

  | column,: | the specified table column, zero-indexed.

Returns:
  a UTF-8 string describing the specified table column, if available.

long Accessibility::Table::getColumnExtentAt | ( | in long | row,
|  | in long | column |
| ) |  |  |

Get the number of columns spanned by the table cell at the specific row and column. (some tables can have cells which span multiple rows and/or columns).

Parameters:

  | row,: | the specified table row, zero-indexed.
  | column,: | the specified table column, zero-indexed.

Returns:
  a long integer indicating the number of columns spanned by the specified cell.

Accessible Accessibility::Table::getColumnHeader | ( | in long | column | ) |

Get the header associated with a table column, if available, as an instance of Accessible. This differs from getColumnDescription, which returns a string.

Parameters:

  | column,: | the specified table column, zero-indexed.

Returns:
  an Accessible representatin of the specified table column, if available.

long Accessibility::Table::getIndexAt | ( | in long | row,
|  | in long | column |
| ) |  |  |

Get the 1-D child index corresponding to the specified 2-D row and column indices.

Note:
  To get the accessible object at a particular (x, y) screen coordinate, use Accessible::getAccessibleAtPoint.

Parameters:

  | row,: | the specified table row, zero-indexed.
  | column,: | the specified table column, zero-indexed.

See also:
  getRowAtIndex, getColumnAtIndex

Returns:
  a long integer which serves as the index of a specified cell in the table, in a form usable by Accessible::getChildAtIndex.

long Accessibility::Table::getRowAtIndex | ( | in long | index | ) |

Get the table row index occupied by the child at a particular 1-D child index.

Parameters:

  | index,: | the specified child index, zero-indexed.

See also:
  getIndexAt(), getColumnAtIndex()

Returns:
  a long integer indicating the first row spanned by the child of a table, at the specified 1-D (zero-offset) `index`.

boolean Accessibility::Table::getRowColumnExtentsAtIndex | ( | in long | index,
|  | out long | row,
|  | out long | col,
|  | out long | row_extents,
|  | out long | col_extents,
|  | out boolean | is_selected |
| ) |  |  |

Given a child index, determine the row and column indices and extents, and whether the cell is currently selected. If the child at `index` is not a cell (for instance, if it is a summary, caption, etc.), `False` is returned.

Parameters:

  | index | the index of the Table child whose row/column extents are requested.
  | row | back-filled with the first table row associated with the cell with child index `index`.
  | col | back-filled with the first table column associated with the cell with child index `index`.
  | row_extents | back-filled with the number of table rows across which child `i` extends.
  | col_extents | back-filled with the number of table columns across which child `i` extends.
  | is_selected | a boolean which is back-filled with `True` if the child at index `i` corresponds to a selected table cell, `False` otherwise.

Example: If the Table child at index '6' extends across columns 5 and 6 of row 2 of a Table instance, and is currently selected, then

     retval = table::getRowColumnExtentsAtIndex (6, row, col,
                                                 row_extents,
                                                 col_extents,
                                                 is_selected);

will return True, and after the call `row`, `col`, `row_extents`, `col_extents`, and `is_selected` will contain `2`, `5`, `1`, `2`, and `True`, respectively.

Returns:
  `True` if the index is associated with a valid table cell, `False` if the index does not correspond to a cell. If `False` is returned, the values of the out parameters are undefined.

Since:
  AT-SPI 1.7.0

string Accessibility::Table::getRowDescription | ( | in long | row | ) |

Get a text description of a particular table row. This differs from AccessibleTable_getRowHeader, which returns an Accessible.

Parameters:

  | row,: | the specified table row, zero-indexed.

Returns:
  a UTF-8 string describing the specified table row, if available.

long Accessibility::Table::getRowExtentAt | ( | in long | row,
|  | in long | column |
| ) |  |  |

Get the number of rows spanned by the table cell at the specific row and column. (some tables can have cells which span multiple rows and/or columns).

Parameters:

  | row,: | the specified table row, zero-indexed.
  | column,: | the specified table column, zero-indexed.

Returns:
  a long integer indicating the number of rows spanned by the specified cell.

Accessible Accessibility::Table::getRowHeader | ( | in long | row | ) |

Get the header associated with a table row, if available. This differs from getRowDescription, which returns a string.

Parameters:

  | row,: | the specified table row, zero-indexed.

Returns:
  an Accessible representatin of the specified table row, if available.

LongSeq Accessibility::Table::getSelectedColumns | ( |  | ) |

Obtain the indices of all columns which are currently selected.

Note:
  Not all tables support column selection.

Returns:
  a sequence of integers comprising the indices of columns currently selected.

LongSeq Accessibility::Table::getSelectedRows | ( |  | ) |

Obtain the indices of all rows which are currently selected.

Note:
  Not all tables support row selection.

Returns:
  a sequence of integers comprising the indices of rows currently selected.

boolean Accessibility::Table::isColumnSelected | ( | in long | column | ) |

Determine whether a table column is selected.

Note:
  Not all tables support column selection.

Parameters:

  | column,: | the column being queried.

Returns:
  `True` if the specified column is currently selected, `False` if not.

boolean Accessibility::Table::isRowSelected | ( | in long | row | ) |

Determine whether a table row is selected.

Note:
  Not all tables support row selection.

Parameters:

  | row,: | the row being queried.

Returns:
  `True` if the specified row is currently selected, `False` if not.

boolean Accessibility::Table::isSelected | ( | in long | row,
|  | in long | column |
| ) |  |  |

Determine whether the cell at a specific row and column is selected.

Parameters:

  | row | a row occupied by the cell whose state is being queried.
  | column | a column occupied by the cell whose state is being queried.

Returns:
  `True` if the specified cell is currently selected, `False` if not.

boolean Accessibility::Table::removeColumnSelection | ( | in long | column | ) |

Remove the specified column from current column selection, if the table's selection model permits it.

Parameters:

  | column |

Note:
  Possible reasons for removeColumnSelection to return `False` include:
  - The table does not support user-instigated modification of selection state
  - The table has no selected columns or does not support deselection by column.

Returns:
  `True` if the specified column was successfully de-selected, `False` if not.

boolean Accessibility::Table::removeRowSelection | ( | in long | row | ) |

Remove the specified row from current row selection, if the table's selection model permits it.

Parameters:

  | row |

Note:
  Possible reasons for removeRowSelection to return `False` include:
  - The table does not support user-instigated Selection
  - The table has no selected rows or does not support deselection by row

Returns:
  `True` if the specified row was successfully de-selected, `False` if not.

## Field Documentation

readonly attribute Accessible Accessibility::Table::caption

An Accessible which represents of a caption for a Table.

readonly attribute long Accessibility::Table::nColumns

The total number of columns in this table (including empty columns), exclusive of columns which are programmatically hidden. Columns which are scrolled out of view or clipped by the current viewport are included.

readonly attribute long Accessibility::Table::nRows

The total number of rows in this table (including empty rows), exclusive of any rows which are programmatically hidden. Rows which are merely scrolled out of view are included.

readonly attribute long Accessibility::Table::nSelectedColumns

The number of columns currently selected. A selected column is one in which all included cells are selected.

Note:
  Not all tables support column selection.

readonly attribute long Accessibility::Table::nSelectedRows

The number of rows currently selected. A selected row is one in which all included cells are selected.

Note:
  Not all tables support row selection.

readonly attribute Accessible Accessibility::Table::summary

An accessible object which summarizes the contents of a Table. This object is frequently itself a Table instance, albeit a simplified one.

The documentation for this interface was generated from the following file:

- /home/liyuan/src/at-spi/idl/Accessibility_Table.idl