1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/accessible/public/nsIAccessibleTable.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,268 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIAccessible; 1.13 +interface nsIArray; 1.14 + 1.15 +[scriptable, uuid(cb0bf7b9-117e-40e2-9e46-189c3d43ce4a)] 1.16 +interface nsIAccessibleTable : nsISupports 1.17 +{ 1.18 + /** 1.19 + * Return the caption accessible for the table. For example, html:caption 1.20 + * element of html:table element. 1.21 + */ 1.22 + readonly attribute nsIAccessible caption; 1.23 + 1.24 + /** 1.25 + * Return summary description for the table. For example, @summary attribute 1.26 + * on html:table element. 1.27 + */ 1.28 + readonly attribute AString summary; 1.29 + 1.30 + /** 1.31 + * Return columns count in the table. 1.32 + */ 1.33 + readonly attribute long columnCount; 1.34 + 1.35 + /** 1.36 + * Return rows count in the table. 1.37 + */ 1.38 + readonly attribute long rowCount; 1.39 + 1.40 + /** 1.41 + * Return the accessible object at the specified row and column in the table. 1.42 + * If both row and column index are valid then the corresponding accessible 1.43 + * object is returned that represents the requested cell regardless of whether 1.44 + * the cell is currently visible (on the screen). 1.45 + * 1.46 + * @param rowIndex [in] the row index to retrieve the cell at 1.47 + * @param columnIndex [in] the column index to retrieve the cell at 1.48 + */ 1.49 + nsIAccessible getCellAt(in long rowIndex, in long columnIndex); 1.50 + 1.51 + /** 1.52 + * Translate the given row and column indices into the corresponding cell 1.53 + * index. 1.54 + * 1.55 + * @param rowIndex [in] the row index to return cell index at 1.56 + * @param columnIndex [in] the column index to return cell index at 1.57 + */ 1.58 + long getCellIndexAt(in long rowIndex, in long columnIndex); 1.59 + 1.60 + /** 1.61 + * Translate the given cell index into the corresponding column index. 1.62 + * 1.63 + * @param cellIndex [in] index of the table cell to return column index for 1.64 + */ 1.65 + long getColumnIndexAt(in long cellIndex); 1.66 + 1.67 + /** 1.68 + * Translate the given cell index into the corresponding row index. 1.69 + * 1.70 + * @param cellIndex [in] index of the table cell to return row index for 1.71 + */ 1.72 + long getRowIndexAt(in long cellIndex); 1.73 + 1.74 + /** 1.75 + * Translate the given cell index into the corresponding row and column 1.76 + * indices. 1.77 + * 1.78 + * @param cellIndex [in] cell index to return row and column indices for 1.79 + * @param rowIndex [out] row index at the given cell index 1.80 + * @param columnIndex [out] column index at the given cell index 1.81 + */ 1.82 + void getRowAndColumnIndicesAt(in long cellIndex, 1.83 + out long rowIndex, out long columnIndex); 1.84 + 1.85 + /** 1.86 + * Return the number of columns occupied by the accessible cell at 1.87 + * the specified row and column in the table. The result differs from 1 if 1.88 + * the specified cell spans multiple columns. 1.89 + * 1.90 + * @param row [in] row index of the cell to return the column extent for 1.91 + * @param column [in] column index of the cell to return the column extent 1.92 + * for 1.93 + */ 1.94 + long getColumnExtentAt(in long row, in long column); 1.95 + 1.96 + /** 1.97 + * Return the number of rows occupied by the accessible cell at the specified 1.98 + * row and column in the table. The result differs from 1 if the specified 1.99 + * cell spans multiple rows. 1.100 + * 1.101 + * @param row [in] row index of the cell to return the column extent for 1.102 + * @param column [in] column index of the cell to return the column extent 1.103 + * for 1.104 + */ 1.105 + long getRowExtentAt(in long row, in long column); 1.106 + 1.107 + /** 1.108 + * Return the description text of the specified column in the table. 1.109 + * 1.110 + * @param columnIndex [in] the column index to retrieve description for 1.111 + */ 1.112 + AString getColumnDescription(in long columnIndex); 1.113 + 1.114 + /** 1.115 + * Return the description text of the specified row in the table. 1.116 + * 1.117 + * @param rowIndex [in] the row index to retrieve description for 1.118 + */ 1.119 + AString getRowDescription(in long rowIndex); 1.120 + 1.121 + /** 1.122 + * Return a boolean value indicating whether the specified column is 1.123 + * selected, i.e. all cells within the column are selected. 1.124 + * 1.125 + * @param columnIndex [in] the column index to determine if it's selected 1.126 + */ 1.127 + boolean isColumnSelected(in long columnIndex); 1.128 + 1.129 + /** 1.130 + * Return a boolean value indicating whether the specified row is selected, 1.131 + * i.e. all cells within the row are selected. 1.132 + * 1.133 + * @param rowIndex [in] the row index to determine whether it's selected 1.134 + */ 1.135 + boolean isRowSelected(in long rowIndex); 1.136 + 1.137 + /** 1.138 + * Return a boolean value indicating whether the specified cell is selected. 1.139 + * 1.140 + * @param rowIndex [in] the row index of the cell 1.141 + * @param columnIndex [in] the column index of the cell 1.142 + */ 1.143 + boolean isCellSelected(in long rowIndex, in long columnIndex); 1.144 + 1.145 + /** 1.146 + * Return the total number of selected cells. 1.147 + */ 1.148 + readonly attribute unsigned long selectedCellCount; 1.149 + 1.150 + /** 1.151 + * Return the total number of selected columns. 1.152 + */ 1.153 + readonly attribute unsigned long selectedColumnCount; 1.154 + 1.155 + /** 1.156 + * Return the total number of selected rows. 1.157 + */ 1.158 + readonly attribute unsigned long selectedRowCount; 1.159 + 1.160 + /** 1.161 + * Return an array of selected cells. 1.162 + */ 1.163 + readonly attribute nsIArray selectedCells; 1.164 + 1.165 + /** 1.166 + * Return an array of cell indices currently selected. 1.167 + * 1.168 + * @param cellsArraySize [in] length of array 1.169 + * @param cellsArray [in] array of indexes of selected cells 1.170 + */ 1.171 + void getSelectedCellIndices(out unsigned long cellsArraySize, 1.172 + [retval, array, size_is(cellsArraySize)] out long cellsArray); 1.173 + 1.174 + /** 1.175 + * Return an array of column indices currently selected. 1.176 + * 1.177 + * @param columnsArraySize [in] length of array 1.178 + * @param columnsArray [in] array of indices of selected columns 1.179 + */ 1.180 + void getSelectedColumnIndices(out unsigned long columnsArraySize, 1.181 + [retval, array, size_is(columnsArraySize)] out long columnsArray); 1.182 + 1.183 + /** 1.184 + * Return an array of row indices currently selected. 1.185 + * 1.186 + * @param rowsArraySize [in] Length of array 1.187 + * @param rowsArray [in] array of indices of selected rows 1.188 + */ 1.189 + void getSelectedRowIndices(out unsigned long rowsArraySize, 1.190 + [retval, array, size_is(rowsArraySize)] out long rowsArray); 1.191 + 1.192 + /** 1.193 + * Select a row and unselects all previously selected rows. 1.194 + * 1.195 + * @param rowIndex [in] the row index to select 1.196 + */ 1.197 + void selectRow(in long rowIndex); 1.198 + 1.199 + /** 1.200 + * Select a column and unselects all previously selected columns. 1.201 + * 1.202 + * @param columnIndex [in] the column index to select 1.203 + */ 1.204 + void selectColumn(in long columnIndex); 1.205 + 1.206 + /** 1.207 + * Unselect the given row, leaving other selected rows selected (if any). 1.208 + * 1.209 + * @param rowIndex [in] the row index to select 1.210 + */ 1.211 + void unselectRow(in long rowIndex); 1.212 + 1.213 + /** 1.214 + * Unselect the given column, leaving other selected columns selected (if any). 1.215 + * 1.216 + * @param columnIndex [in] the column index to select 1.217 + */ 1.218 + void unselectColumn(in long columnIndex); 1.219 + 1.220 + /** 1.221 + * Use heuristics to determine if table is most likely used for layout. 1.222 + */ 1.223 + boolean isProbablyForLayout(); 1.224 +}; 1.225 + 1.226 + 1.227 +[scriptable, uuid(654e296d-fae6-452b-987d-746b20b9514b)] 1.228 +interface nsIAccessibleTableCell : nsISupports 1.229 +{ 1.230 + /** 1.231 + * Return host table accessible. 1.232 + */ 1.233 + readonly attribute nsIAccessibleTable table; 1.234 + 1.235 + /** 1.236 + * Return column index of this cell. 1.237 + */ 1.238 + readonly attribute long columnIndex; 1.239 + 1.240 + /** 1.241 + * Return row index of this cell. 1.242 + */ 1.243 + readonly attribute long rowIndex; 1.244 + 1.245 + /** 1.246 + * Return the number of columns occupied by this cell. The result differs 1.247 + * from 1 if the specified cell spans multiple columns. 1.248 + */ 1.249 + readonly attribute long columnExtent; 1.250 + 1.251 + /** 1.252 + * Return the number of rows occupied by this accessible cell. The result 1.253 + * differs from 1 if the specified cell spans multiple rows. 1.254 + */ 1.255 + readonly attribute long rowExtent; 1.256 + 1.257 + /** 1.258 + * Return an array of column header cells for this cell. 1.259 + */ 1.260 + readonly attribute nsIArray columnHeaderCells; 1.261 + 1.262 + /** 1.263 + * Return an array of row header cells for this cell. 1.264 + */ 1.265 + readonly attribute nsIArray rowHeaderCells; 1.266 + 1.267 + /** 1.268 + * Return a boolean value indicating whether this cell is selected. 1.269 + */ 1.270 + boolean isSelected(); 1.271 +};