nsIAccessibleTable.idl (6989B)
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 2 * 3 * This Source Code Form is subject to the terms of the Mozilla Public 4 * License, v. 2.0. If a copy of the MPL was not distributed with this 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 6 7 #include "nsISupports.idl" 8 9 interface nsIAccessible; 10 interface nsIArray; 11 12 [scriptable, builtinclass, uuid(cb0bf7b9-117e-40e2-9e46-189c3d43ce4a)] 13 interface nsIAccessibleTable : nsISupports 14 { 15 /** 16 * Return the caption accessible for the table. For example, html:caption 17 * element of html:table element. 18 */ 19 readonly attribute nsIAccessible caption; 20 21 /** 22 * Return summary description for the table. For example, @summary attribute 23 * on html:table element. 24 */ 25 readonly attribute AString summary; 26 27 /** 28 * Return columns count in the table. 29 */ 30 readonly attribute long columnCount; 31 32 /** 33 * Return rows count in the table. 34 */ 35 readonly attribute long rowCount; 36 37 /** 38 * Return the accessible object at the specified row and column in the table. 39 * If both row and column index are valid then the corresponding accessible 40 * object is returned that represents the requested cell regardless of whether 41 * the cell is currently visible (on the screen). 42 * 43 * @param rowIndex [in] the row index to retrieve the cell at 44 * @param columnIndex [in] the column index to retrieve the cell at 45 */ 46 nsIAccessible getCellAt(in long rowIndex, in long columnIndex); 47 48 /** 49 * Translate the given row and column indices into the corresponding cell 50 * index. 51 * 52 * @param rowIndex [in] the row index to return cell index at 53 * @param columnIndex [in] the column index to return cell index at 54 */ 55 long getCellIndexAt(in long rowIndex, in long columnIndex); 56 57 /** 58 * Translate the given cell index into the corresponding column index. 59 * 60 * @param cellIndex [in] index of the table cell to return column index for 61 */ 62 long getColumnIndexAt(in long cellIndex); 63 64 /** 65 * Translate the given cell index into the corresponding row index. 66 * 67 * @param cellIndex [in] index of the table cell to return row index for 68 */ 69 long getRowIndexAt(in long cellIndex); 70 71 /** 72 * Translate the given cell index into the corresponding row and column 73 * indices. 74 * 75 * @param cellIndex [in] cell index to return row and column indices for 76 * @param rowIndex [out] row index at the given cell index 77 * @param columnIndex [out] column index at the given cell index 78 */ 79 void getRowAndColumnIndicesAt(in long cellIndex, 80 out long rowIndex, out long columnIndex); 81 82 /** 83 * Return the number of columns occupied by the accessible cell at 84 * the specified row and column in the table. The result differs from 1 if 85 * the specified cell spans multiple columns. 86 * 87 * @param row [in] row index of the cell to return the column extent for 88 * @param column [in] column index of the cell to return the column extent 89 * for 90 */ 91 long getColumnExtentAt(in long row, in long column); 92 93 /** 94 * Return the number of rows occupied by the accessible cell at the specified 95 * row and column in the table. The result differs from 1 if the specified 96 * cell spans multiple rows. 97 * 98 * @param row [in] row index of the cell to return the column extent for 99 * @param column [in] column index of the cell to return the column extent 100 * for 101 */ 102 long getRowExtentAt(in long row, in long column); 103 104 /** 105 * Return the description text of the specified column in the table. 106 * 107 * @param columnIndex [in] the column index to retrieve description for 108 */ 109 AString getColumnDescription(in long columnIndex); 110 111 /** 112 * Return the description text of the specified row in the table. 113 * 114 * @param rowIndex [in] the row index to retrieve description for 115 */ 116 AString getRowDescription(in long rowIndex); 117 118 /** 119 * Return a boolean value indicating whether the specified column is 120 * selected, i.e. all cells within the column are selected. 121 * 122 * @param columnIndex [in] the column index to determine if it's selected 123 */ 124 boolean isColumnSelected(in long columnIndex); 125 126 /** 127 * Return a boolean value indicating whether the specified row is selected, 128 * i.e. all cells within the row are selected. 129 * 130 * @param rowIndex [in] the row index to determine whether it's selected 131 */ 132 boolean isRowSelected(in long rowIndex); 133 134 /** 135 * Return a boolean value indicating whether the specified cell is selected. 136 * 137 * @param rowIndex [in] the row index of the cell 138 * @param columnIndex [in] the column index of the cell 139 */ 140 boolean isCellSelected(in long rowIndex, in long columnIndex); 141 142 /** 143 * Return the total number of selected cells. 144 */ 145 readonly attribute unsigned long selectedCellCount; 146 147 /** 148 * Return the total number of selected columns. 149 */ 150 readonly attribute unsigned long selectedColumnCount; 151 152 /** 153 * Return the total number of selected rows. 154 */ 155 readonly attribute unsigned long selectedRowCount; 156 157 /** 158 * Return an array of selected cells. 159 */ 160 readonly attribute nsIArray selectedCells; 161 162 /** 163 * Return an array of cell indices currently selected. 164 * 165 * @return array of indexes of selected cells 166 */ 167 Array<uint32_t> getSelectedCellIndices(); 168 169 /** 170 * Return an array of column indices currently selected. 171 * 172 * @return array of indices of selected columns 173 */ 174 Array<uint32_t> getSelectedColumnIndices(); 175 176 /** 177 * Return an array of row indices currently selected. 178 * 179 * @return array of indices of selected rows 180 */ 181 Array<uint32_t> getSelectedRowIndices(); 182 183 /** 184 * Use heuristics to determine if table is most likely used for layout. 185 */ 186 boolean isProbablyForLayout(); 187 }; 188 189 190 [scriptable, builtinclass, uuid(654e296d-fae6-452b-987d-746b20b9514b)] 191 interface nsIAccessibleTableCell : nsISupports 192 { 193 /** 194 * Return host table accessible. 195 */ 196 readonly attribute nsIAccessibleTable table; 197 198 /** 199 * Return column index of this cell. 200 */ 201 readonly attribute long columnIndex; 202 203 /** 204 * Return row index of this cell. 205 */ 206 readonly attribute long rowIndex; 207 208 /** 209 * Return the number of columns occupied by this cell. The result differs 210 * from 1 if the specified cell spans multiple columns. 211 */ 212 readonly attribute long columnExtent; 213 214 /** 215 * Return the number of rows occupied by this accessible cell. The result 216 * differs from 1 if the specified cell spans multiple rows. 217 */ 218 readonly attribute long rowExtent; 219 220 /** 221 * Return an array of column header cells for this cell. 222 */ 223 readonly attribute nsIArray columnHeaderCells; 224 225 /** 226 * Return an array of row header cells for this cell. 227 */ 228 readonly attribute nsIArray rowHeaderCells; 229 230 /** 231 * Return a boolean value indicating whether this cell is selected. 232 */ 233 boolean isSelected(); 234 };