1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is the Mozilla browser.
18 * The Initial Developer of the Original Code is
19 * Netscape Communications Corporation.
20 * Portions created by the Initial Developer are Copyright (C) 1999
21 * the Initial Developer. All Rights Reserved.
24 * Paul Sandoz (paul.sandoz@sun.com)
25 * Bill Haneman (bill.haneman@sun.com)
26 * John Gaunt (jgaunt@netscape.com)
27 * Alexander Surkov <surkov.alexander@gmail.com>
29 * Alternatively, the contents of this file may be used under the terms of
30 * either of the GNU General Public License Version 2 or later (the "GPL"),
31 * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
32 * in which case the provisions of the GPL or the LGPL are applicable instead
33 * of those above. If you wish to allow use of your version of this file only
34 * under the terms of either the GPL or the LGPL, and not to allow others to
35 * use your version of this file under the terms of the MPL, indicate your
36 * decision by deleting the provisions above and replace them with the notice
37 * and other provisions required by the GPL or the LGPL. If you do not delete
38 * the provisions above, a recipient may use your version of this file under
39 * the terms of any one of the MPL, the GPL or the LGPL.
41 * ***** END LICENSE BLOCK ***** */
43 #include
"nsISupports.idl"
45 interface nsIAccessible
;
48 [scriptable
, uuid(cb0bf7b9
-117e-40e2
-9e46
-189c3d43ce4a
)]
49 interface nsIAccessibleTable
: nsISupports
52 * Return the caption accessible for the table. For example, html:caption
53 * element of html:table element.
55 readonly attribute nsIAccessible caption
;
58 * Return summary description for the table. For example, @summary attribute
59 * on html:table element.
61 readonly attribute AString summary
;
64 * Return columns count in the table.
66 readonly attribute
long columnCount
;
69 * Return rows count in the table.
71 readonly attribute
long rowCount
;
74 * Return the accessible object at the specified row and column in the table.
75 * If both row and column index are valid then the corresponding accessible
76 * object is returned that represents the requested cell regardless of whether
77 * the cell is currently visible (on the screen).
79 * @param rowIndex [in] the row index to retrieve the cell at
80 * @param columnIndex [in] the column index to retrieve the cell at
82 nsIAccessible getCellAt
(in long rowIndex
, in long columnIndex
);
85 * Translate the given row and column indices into the corresponding cell
88 * @param rowIndex [in] the row index to return cell index at
89 * @param columnIndex [in] the column index to return cell index at
91 long getCellIndexAt
(in long rowIndex
, in long columnIndex
);
94 * Translate the given cell index into the corresponding column index.
96 * @param cellIndex [in] index of the table cell to return column index for
98 long getColumnIndexAt
(in long cellIndex
);
101 * Translate the given cell index into the corresponding row index.
103 * @param cellIndex [in] index of the table cell to return row index for
105 long getRowIndexAt
(in long cellIndex
);
108 * Translate the given cell index into the corresponding row and column
111 * @param cellIndex [in] cell index to return row and column indices for
112 * @param rowIndex [out] row index at the given cell index
113 * @param columnIndex [out] column index at the given cell index
115 void getRowAndColumnIndicesAt
(in long cellIndex
,
116 out long rowIndex
, out long columnIndex
);
119 * Return the number of columns occupied by the accessible cell at
120 * the specified row and column in the table. The result differs from 1 if
121 * the specified cell spans multiple columns.
123 * @param row [in] row index of the cell to return the column extent for
124 * @param column [in] column index of the cell to return the column extent
127 long getColumnExtentAt
(in long row
, in long column
);
130 * Return the number of rows occupied by the accessible cell at the specified
131 * row and column in the table. The result differs from 1 if the specified
132 * cell spans multiple rows.
134 * @param row [in] row index of the cell to return the column extent for
135 * @param column [in] column index of the cell to return the column extent
138 long getRowExtentAt
(in long row
, in long column
);
141 * Return the description text of the specified column in the table.
143 * @param columnIndex [in] the column index to retrieve description for
145 AString getColumnDescription
(in long columnIndex
);
148 * Return the description text of the specified row in the table.
150 * @param rowIndex [in] the row index to retrieve description for
152 AString getRowDescription
(in long rowIndex
);
155 * Return a boolean value indicating whether the specified column is
156 * selected, i.e. all cells within the column are selected.
158 * @param columnIndex [in] the column index to determine if it's selected
160 boolean isColumnSelected
(in long columnIndex
);
163 * Return a boolean value indicating whether the specified row is selected,
164 * i.e. all cells within the row are selected.
166 * @param rowIndex [in] the row index to determine whether it's selected
168 boolean isRowSelected
(in long rowIndex
);
171 * Return a boolean value indicating whether the specified cell is selected.
173 * @param rowIndex [in] the row index of the cell
174 * @param columnIndex [in] the column index of the cell
176 boolean isCellSelected
(in long rowIndex
, in long columnIndex
);
179 * Return the total number of selected cells.
181 readonly attribute
unsigned long selectedCellCount
;
184 * Return the total number of selected columns.
186 readonly attribute
unsigned long selectedColumnCount
;
189 * Return the total number of selected rows.
191 readonly attribute
unsigned long selectedRowCount
;
194 * Return an array of selected cells.
196 readonly attribute nsIArray selectedCells
;
199 * Return an array of cell indices currently selected.
201 * @param cellsArraySize [in] length of array
202 * @param cellsArray [in] array of indexes of selected cells
204 void getSelectedCellIndices
(out unsigned long cellsArraySize
,
205 [retval, array
, size_is(cellsArraySize
)] out long cellsArray
);
208 * Return an array of column indices currently selected.
210 * @param columnsArraySize [in] length of array
211 * @param columnsArray [in] array of indices of selected columns
213 void getSelectedColumnIndices
(out unsigned long columnsArraySize
,
214 [retval, array
, size_is(columnsArraySize
)] out long columnsArray
);
217 * Return an array of row indices currently selected.
219 * @param rowsArraySize [in] Length of array
220 * @param rowsArray [in] array of indices of selected rows
222 void getSelectedRowIndices
(out unsigned long rowsArraySize
,
223 [retval, array
, size_is(rowsArraySize
)] out long rowsArray
);
226 * Select a row and unselects all previously selected rows.
228 * @param rowIndex [in] the row index to select
230 void selectRow
(in long rowIndex
);
233 * Select a column and unselects all previously selected columns.
235 * @param columnIndex [in] the column index to select
237 void selectColumn
(in long columnIndex
);
240 * Unselect the given row, leaving other selected rows selected (if any).
242 * @param rowIndex [in] the row index to select
244 void unselectRow
(in long rowIndex
);
247 * Unselect the given column, leaving other selected columns selected (if any).
249 * @param columnIndex [in] the column index to select
251 void unselectColumn
(in long columnIndex
);
254 * Use heuristics to determine if table is most likely used for layout.
256 boolean isProbablyForLayout
();
260 [scriptable
, uuid(654e296d
-fae6
-452b
-987d
-746b20b9514b
)]
261 interface nsIAccessibleTableCell
: nsISupports
264 * Return host table accessible.
266 readonly attribute nsIAccessibleTable table
;
269 * Return column index of this cell.
271 readonly attribute
long columnIndex
;
274 * Return row index of this cell.
276 readonly attribute
long rowIndex
;
279 * Return the number of columns occupied by this cell. The result differs
280 * from 1 if the specified cell spans multiple columns.
282 readonly attribute
long columnExtent
;
285 * Return the number of rows occupied by this accessible cell. The result
286 * differs from 1 if the specified cell spans multiple rows.
288 readonly attribute
long rowExtent
;
291 * Return an array of column header cells for this cell.
293 readonly attribute nsIArray columnHeaderCells
;
296 * Return an array of row header cells for this cell.
298 readonly attribute nsIArray rowHeaderCells
;
301 * Return a boolean value indicating whether this cell is selected.
303 boolean isSelected
();