|
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, 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 * @param cellsArraySize [in] length of array |
|
166 * @param cellsArray [in] array of indexes of selected cells |
|
167 */ |
|
168 void getSelectedCellIndices(out unsigned long cellsArraySize, |
|
169 [retval, array, size_is(cellsArraySize)] out long cellsArray); |
|
170 |
|
171 /** |
|
172 * Return an array of column indices currently selected. |
|
173 * |
|
174 * @param columnsArraySize [in] length of array |
|
175 * @param columnsArray [in] array of indices of selected columns |
|
176 */ |
|
177 void getSelectedColumnIndices(out unsigned long columnsArraySize, |
|
178 [retval, array, size_is(columnsArraySize)] out long columnsArray); |
|
179 |
|
180 /** |
|
181 * Return an array of row indices currently selected. |
|
182 * |
|
183 * @param rowsArraySize [in] Length of array |
|
184 * @param rowsArray [in] array of indices of selected rows |
|
185 */ |
|
186 void getSelectedRowIndices(out unsigned long rowsArraySize, |
|
187 [retval, array, size_is(rowsArraySize)] out long rowsArray); |
|
188 |
|
189 /** |
|
190 * Select a row and unselects all previously selected rows. |
|
191 * |
|
192 * @param rowIndex [in] the row index to select |
|
193 */ |
|
194 void selectRow(in long rowIndex); |
|
195 |
|
196 /** |
|
197 * Select a column and unselects all previously selected columns. |
|
198 * |
|
199 * @param columnIndex [in] the column index to select |
|
200 */ |
|
201 void selectColumn(in long columnIndex); |
|
202 |
|
203 /** |
|
204 * Unselect the given row, leaving other selected rows selected (if any). |
|
205 * |
|
206 * @param rowIndex [in] the row index to select |
|
207 */ |
|
208 void unselectRow(in long rowIndex); |
|
209 |
|
210 /** |
|
211 * Unselect the given column, leaving other selected columns selected (if any). |
|
212 * |
|
213 * @param columnIndex [in] the column index to select |
|
214 */ |
|
215 void unselectColumn(in long columnIndex); |
|
216 |
|
217 /** |
|
218 * Use heuristics to determine if table is most likely used for layout. |
|
219 */ |
|
220 boolean isProbablyForLayout(); |
|
221 }; |
|
222 |
|
223 |
|
224 [scriptable, uuid(654e296d-fae6-452b-987d-746b20b9514b)] |
|
225 interface nsIAccessibleTableCell : nsISupports |
|
226 { |
|
227 /** |
|
228 * Return host table accessible. |
|
229 */ |
|
230 readonly attribute nsIAccessibleTable table; |
|
231 |
|
232 /** |
|
233 * Return column index of this cell. |
|
234 */ |
|
235 readonly attribute long columnIndex; |
|
236 |
|
237 /** |
|
238 * Return row index of this cell. |
|
239 */ |
|
240 readonly attribute long rowIndex; |
|
241 |
|
242 /** |
|
243 * Return the number of columns occupied by this cell. The result differs |
|
244 * from 1 if the specified cell spans multiple columns. |
|
245 */ |
|
246 readonly attribute long columnExtent; |
|
247 |
|
248 /** |
|
249 * Return the number of rows occupied by this accessible cell. The result |
|
250 * differs from 1 if the specified cell spans multiple rows. |
|
251 */ |
|
252 readonly attribute long rowExtent; |
|
253 |
|
254 /** |
|
255 * Return an array of column header cells for this cell. |
|
256 */ |
|
257 readonly attribute nsIArray columnHeaderCells; |
|
258 |
|
259 /** |
|
260 * Return an array of row header cells for this cell. |
|
261 */ |
|
262 readonly attribute nsIArray rowHeaderCells; |
|
263 |
|
264 /** |
|
265 * Return a boolean value indicating whether this cell is selected. |
|
266 */ |
|
267 boolean isSelected(); |
|
268 }; |