Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / javax / accessibility / AccessibleTable.java
blobc008f455ed13b27a3a439430e8577c4540b9414a
1 /* AccessibleTable.java -- aids in accessibly manipulating tables
2 Copyright (C) 2002, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package javax.accessibility;
41 /**
42 * Objects which present information in a 2-dimensional table should implement
43 * this interface. Accessibility software can use the implementations of
44 * this interface to navigate and change the attributes of the table.
46 * <p>The <code>AccessibleContext.getAccessibleTable()</code> method
47 * should return <code>null</code> if an object does not implement this
48 * interface.
50 * @author Eric Blake (ebb9@email.byu.edu)
51 * @see Accessible
52 * @see AccessibleContext
53 * @see AccessibleContext#getAccessibleTable()
54 * @since 1.2
55 * @status updated to 1.4
57 public interface AccessibleTable
59 /**
60 * Return the caption for the table, or null if unknown.
62 * @return the table caption
64 Accessible getAccessibleCaption();
66 /**
67 * Set the table caption.
69 * @param caption the new caption
71 void setAccessibleCaption(Accessible caption);
73 /**
74 * Return the summary description of the table, or null if unknown.
76 * @return the summary description
78 Accessible getAccessibleSummary();
80 /**
81 * Set the table summary description.
83 * @param summary the new summary
85 void setAccessibleSummary(Accessible summary);
87 /**
88 * Return the number of rows in the table.
90 * @return the row count
92 int getAccessibleRowCount();
94 /**
95 * Return the number of columns in the table.
97 * @return the column count
99 int getAccessibleColumnCount();
102 * Return the cell at the specified row and column, or null if out of bounds.
104 * @param r the 0-based row index
105 * @param c the 0-based column index
106 * @return the cell at (r,c)
108 Accessible getAccessibleAt(int r, int c);
111 * Returns the number of merged rows occupied at the specified row and
112 * column, or 0 if out of bounds.
114 * @param r the 0-based row index
115 * @param c the 0-based column index
116 * @return the row extent at (r,c)
118 int getAccessibleRowExtentAt(int r, int c);
121 * Returns the number of merged columns occupied at the specified row and
122 * column, or 0 if out of bounds.
124 * @param r the 0-based row index
125 * @param c the 0-based column index
126 * @return the column extent at (r,c)
128 int getAccessibleColumnExtentAt(int r, int c);
131 * Return the row headers as a table.
133 * @return the row headers, or null if there are none
135 AccessibleTable getAccessibleRowHeader();
138 * Set the row headers.
140 * @param header the new row header
142 // XXX What happens if header is incompatible size?
143 void setAccessibleRowHeader(AccessibleTable header);
146 * Return the column headers as a table.
148 * @return the column headers, or null if there are none
150 AccessibleTable getAccessibleColumnHeader();
153 * Set the column headers.
155 * @param header the new column header
157 // XXX What happens if header is incompatible size?
158 void setAccessibleColumnHeader(AccessibleTable header);
161 * Return the description of a row, or null if there is none or the index
162 * is out of bounds.
164 * @param r the 0-based row index
165 * @return the description
167 Accessible getAccessibleRowDescription(int r);
170 * Set the description of a row. Does nothing if the index is invalid.
172 * @param r the 0-based row index
173 * @param description the new description
175 void setAccessibleRowDescription(int r, Accessible description);
178 * Return the description of a column, or null if there is none or the index
179 * is out of bounds.
181 * @param c the 0-based column index
182 * @return the description
184 Accessible getAccessibleColumnDescription(int c);
187 * Set the description of a column. Does nothing if the index is invalid.
189 * @param c the 0-based column index
190 * @param description the new description
192 void setAccessibleColumnDescription(int c, Accessible description);
195 * Return whether the cell at the specified location is selected. Returns
196 * false if the index is out of bounds.
198 * @param r the 0-based row index
199 * @param c the 0-based column index
200 * @return true if that cell is selected
202 boolean isAccessibleSelected(int r, int c);
205 * Return whether the specified row is selected. Returns false if the
206 * index is out of bounds.
208 * @param r the 0-based row index
209 * @return true if that row is selected
211 boolean isAccessibleRowSelected(int r);
214 * Return whether the specified column is selected. Returns false if the
215 * index is out of bounds.
217 * @param c the 0-based column index
218 * @return true if that column is selected
220 boolean isAccessibleColumnSelected(int c);
223 * Return the selected rows. May be null or empty if there is no selection.
225 * @return the indices of selected rows
227 int[] getSelectedAccessibleRows();
230 * Return the selected columns. May be null or empty if there is no
231 * selection.
233 * @return the indices of selected columns
235 int[] getSelectedAccessibleColumns();
236 } // interface AccessibleTable