michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIAccessible; michael@0: interface nsIArray; michael@0: michael@0: [scriptable, uuid(cb0bf7b9-117e-40e2-9e46-189c3d43ce4a)] michael@0: interface nsIAccessibleTable : nsISupports michael@0: { michael@0: /** michael@0: * Return the caption accessible for the table. For example, html:caption michael@0: * element of html:table element. michael@0: */ michael@0: readonly attribute nsIAccessible caption; michael@0: michael@0: /** michael@0: * Return summary description for the table. For example, @summary attribute michael@0: * on html:table element. michael@0: */ michael@0: readonly attribute AString summary; michael@0: michael@0: /** michael@0: * Return columns count in the table. michael@0: */ michael@0: readonly attribute long columnCount; michael@0: michael@0: /** michael@0: * Return rows count in the table. michael@0: */ michael@0: readonly attribute long rowCount; michael@0: michael@0: /** michael@0: * Return the accessible object at the specified row and column in the table. michael@0: * If both row and column index are valid then the corresponding accessible michael@0: * object is returned that represents the requested cell regardless of whether michael@0: * the cell is currently visible (on the screen). michael@0: * michael@0: * @param rowIndex [in] the row index to retrieve the cell at michael@0: * @param columnIndex [in] the column index to retrieve the cell at michael@0: */ michael@0: nsIAccessible getCellAt(in long rowIndex, in long columnIndex); michael@0: michael@0: /** michael@0: * Translate the given row and column indices into the corresponding cell michael@0: * index. michael@0: * michael@0: * @param rowIndex [in] the row index to return cell index at michael@0: * @param columnIndex [in] the column index to return cell index at michael@0: */ michael@0: long getCellIndexAt(in long rowIndex, in long columnIndex); michael@0: michael@0: /** michael@0: * Translate the given cell index into the corresponding column index. michael@0: * michael@0: * @param cellIndex [in] index of the table cell to return column index for michael@0: */ michael@0: long getColumnIndexAt(in long cellIndex); michael@0: michael@0: /** michael@0: * Translate the given cell index into the corresponding row index. michael@0: * michael@0: * @param cellIndex [in] index of the table cell to return row index for michael@0: */ michael@0: long getRowIndexAt(in long cellIndex); michael@0: michael@0: /** michael@0: * Translate the given cell index into the corresponding row and column michael@0: * indices. michael@0: * michael@0: * @param cellIndex [in] cell index to return row and column indices for michael@0: * @param rowIndex [out] row index at the given cell index michael@0: * @param columnIndex [out] column index at the given cell index michael@0: */ michael@0: void getRowAndColumnIndicesAt(in long cellIndex, michael@0: out long rowIndex, out long columnIndex); michael@0: michael@0: /** michael@0: * Return the number of columns occupied by the accessible cell at michael@0: * the specified row and column in the table. The result differs from 1 if michael@0: * the specified cell spans multiple columns. michael@0: * michael@0: * @param row [in] row index of the cell to return the column extent for michael@0: * @param column [in] column index of the cell to return the column extent michael@0: * for michael@0: */ michael@0: long getColumnExtentAt(in long row, in long column); michael@0: michael@0: /** michael@0: * Return the number of rows occupied by the accessible cell at the specified michael@0: * row and column in the table. The result differs from 1 if the specified michael@0: * cell spans multiple rows. michael@0: * michael@0: * @param row [in] row index of the cell to return the column extent for michael@0: * @param column [in] column index of the cell to return the column extent michael@0: * for michael@0: */ michael@0: long getRowExtentAt(in long row, in long column); michael@0: michael@0: /** michael@0: * Return the description text of the specified column in the table. michael@0: * michael@0: * @param columnIndex [in] the column index to retrieve description for michael@0: */ michael@0: AString getColumnDescription(in long columnIndex); michael@0: michael@0: /** michael@0: * Return the description text of the specified row in the table. michael@0: * michael@0: * @param rowIndex [in] the row index to retrieve description for michael@0: */ michael@0: AString getRowDescription(in long rowIndex); michael@0: michael@0: /** michael@0: * Return a boolean value indicating whether the specified column is michael@0: * selected, i.e. all cells within the column are selected. michael@0: * michael@0: * @param columnIndex [in] the column index to determine if it's selected michael@0: */ michael@0: boolean isColumnSelected(in long columnIndex); michael@0: michael@0: /** michael@0: * Return a boolean value indicating whether the specified row is selected, michael@0: * i.e. all cells within the row are selected. michael@0: * michael@0: * @param rowIndex [in] the row index to determine whether it's selected michael@0: */ michael@0: boolean isRowSelected(in long rowIndex); michael@0: michael@0: /** michael@0: * Return a boolean value indicating whether the specified cell is selected. michael@0: * michael@0: * @param rowIndex [in] the row index of the cell michael@0: * @param columnIndex [in] the column index of the cell michael@0: */ michael@0: boolean isCellSelected(in long rowIndex, in long columnIndex); michael@0: michael@0: /** michael@0: * Return the total number of selected cells. michael@0: */ michael@0: readonly attribute unsigned long selectedCellCount; michael@0: michael@0: /** michael@0: * Return the total number of selected columns. michael@0: */ michael@0: readonly attribute unsigned long selectedColumnCount; michael@0: michael@0: /** michael@0: * Return the total number of selected rows. michael@0: */ michael@0: readonly attribute unsigned long selectedRowCount; michael@0: michael@0: /** michael@0: * Return an array of selected cells. michael@0: */ michael@0: readonly attribute nsIArray selectedCells; michael@0: michael@0: /** michael@0: * Return an array of cell indices currently selected. michael@0: * michael@0: * @param cellsArraySize [in] length of array michael@0: * @param cellsArray [in] array of indexes of selected cells michael@0: */ michael@0: void getSelectedCellIndices(out unsigned long cellsArraySize, michael@0: [retval, array, size_is(cellsArraySize)] out long cellsArray); michael@0: michael@0: /** michael@0: * Return an array of column indices currently selected. michael@0: * michael@0: * @param columnsArraySize [in] length of array michael@0: * @param columnsArray [in] array of indices of selected columns michael@0: */ michael@0: void getSelectedColumnIndices(out unsigned long columnsArraySize, michael@0: [retval, array, size_is(columnsArraySize)] out long columnsArray); michael@0: michael@0: /** michael@0: * Return an array of row indices currently selected. michael@0: * michael@0: * @param rowsArraySize [in] Length of array michael@0: * @param rowsArray [in] array of indices of selected rows michael@0: */ michael@0: void getSelectedRowIndices(out unsigned long rowsArraySize, michael@0: [retval, array, size_is(rowsArraySize)] out long rowsArray); michael@0: michael@0: /** michael@0: * Select a row and unselects all previously selected rows. michael@0: * michael@0: * @param rowIndex [in] the row index to select michael@0: */ michael@0: void selectRow(in long rowIndex); michael@0: michael@0: /** michael@0: * Select a column and unselects all previously selected columns. michael@0: * michael@0: * @param columnIndex [in] the column index to select michael@0: */ michael@0: void selectColumn(in long columnIndex); michael@0: michael@0: /** michael@0: * Unselect the given row, leaving other selected rows selected (if any). michael@0: * michael@0: * @param rowIndex [in] the row index to select michael@0: */ michael@0: void unselectRow(in long rowIndex); michael@0: michael@0: /** michael@0: * Unselect the given column, leaving other selected columns selected (if any). michael@0: * michael@0: * @param columnIndex [in] the column index to select michael@0: */ michael@0: void unselectColumn(in long columnIndex); michael@0: michael@0: /** michael@0: * Use heuristics to determine if table is most likely used for layout. michael@0: */ michael@0: boolean isProbablyForLayout(); michael@0: }; michael@0: michael@0: michael@0: [scriptable, uuid(654e296d-fae6-452b-987d-746b20b9514b)] michael@0: interface nsIAccessibleTableCell : nsISupports michael@0: { michael@0: /** michael@0: * Return host table accessible. michael@0: */ michael@0: readonly attribute nsIAccessibleTable table; michael@0: michael@0: /** michael@0: * Return column index of this cell. michael@0: */ michael@0: readonly attribute long columnIndex; michael@0: michael@0: /** michael@0: * Return row index of this cell. michael@0: */ michael@0: readonly attribute long rowIndex; michael@0: michael@0: /** michael@0: * Return the number of columns occupied by this cell. The result differs michael@0: * from 1 if the specified cell spans multiple columns. michael@0: */ michael@0: readonly attribute long columnExtent; michael@0: michael@0: /** michael@0: * Return the number of rows occupied by this accessible cell. The result michael@0: * differs from 1 if the specified cell spans multiple rows. michael@0: */ michael@0: readonly attribute long rowExtent; michael@0: michael@0: /** michael@0: * Return an array of column header cells for this cell. michael@0: */ michael@0: readonly attribute nsIArray columnHeaderCells; michael@0: michael@0: /** michael@0: * Return an array of row header cells for this cell. michael@0: */ michael@0: readonly attribute nsIArray rowHeaderCells; michael@0: michael@0: /** michael@0: * Return a boolean value indicating whether this cell is selected. michael@0: */ michael@0: boolean isSelected(); michael@0: };