Bug 574778 - Fix win widget's ConstrainPosition so that it supports full screen windo...
[mozilla-central.git] / accessible / public / nsIAccessible.idl
blobfccbfe07a1845b6d4b1049a1142310f4d1baf2bb
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 /* ***** BEGIN LICENSE BLOCK *****
3 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
5 * The contents of this file are subject to the Mozilla Public License Version
6 * 1.1 (the "License"); you may not use this file except in compliance with
7 * the License. You may obtain a copy of the License at
8 * http://www.mozilla.org/MPL/
10 * Software distributed under the License is distributed on an "AS IS" basis,
11 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12 * for the specific language governing rights and limitations under the
13 * License.
15 * The Original Code is mozilla.org code.
17 * The Initial Developer of the Original Code is
18 * Netscape Communications Corporation.
19 * Portions created by the Initial Developer are Copyright (C) 2003
20 * the Initial Developer. All Rights Reserved.
22 * Original Author: Eric D Vaughan (evaughan@netscape.com)
23 * Contributor(s): Aaron Leventhal (aaronl@netscape.com)
24 * John Gaunt (jgaunt@netscape.com)
25 * Kyle Yuan (kyle.yuan@sun.com)
26 * HÃ¥kan Waara (hwaara@gmail.com)
28 * Alternatively, the contents of this file may be used under the terms of
29 * either the GNU General Public License Version 2 or later (the "GPL"), or
30 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
31 * in which case the provisions of the GPL or the LGPL are applicable instead
32 * of those above. If you wish to allow use of your version of this file only
33 * under the terms of either the GPL or the LGPL, and not to allow others to
34 * use your version of this file under the terms of the MPL, indicate your
35 * decision by deleting the provisions above and replace them with the notice
36 * and other provisions required by the GPL or the LGPL. If you do not delete
37 * the provisions above, a recipient may use your version of this file under
38 * the terms of any one of the MPL, the GPL or the LGPL.
40 * ***** END LICENSE BLOCK ***** */
42 #include "nsISupports.idl"
43 #include "nsIArray.idl"
45 interface nsIPersistentProperties;
46 interface nsIDOMDOMStringList;
47 interface nsIAccessibleRelation;
49 /**
50 * A cross-platform interface that supports platform-specific
51 * accessibility APIs like MSAA and ATK. Contains the sum of what's needed
52 * to support IAccessible as well as ATK's generic accessibility objects.
53 * Can also be used by in-process accessibility clients to get information
54 * about objects in the accessible tree. The accessible tree is a subset of
55 * nodes in the DOM tree -- such as documents, focusable elements and text.
56 * Mozilla creates the implementations of nsIAccessible on demand.
57 * See http://www.mozilla.org/projects/ui/accessibility for more information.
59 [scriptable, uuid(c81d8f8c-8585-4094-bc7c-71dd01494906)]
60 interface nsIAccessible : nsISupports
62 /**
63 * Parent node in accessible tree.
65 readonly attribute nsIAccessible parent;
67 /**
68 * Next sibling in accessible tree
70 readonly attribute nsIAccessible nextSibling;
72 /**
73 * Previous sibling in accessible tree
75 readonly attribute nsIAccessible previousSibling;
77 /**
78 * First child in accessible tree
80 readonly attribute nsIAccessible firstChild;
82 /**
83 * Last child in accessible tree
85 readonly attribute nsIAccessible lastChild;
87 /**
88 * Array of all this element's children.
90 readonly attribute nsIArray children;
92 /**
93 * Number of accessible children
95 readonly attribute long childCount;
97 /**
98 * The 0-based index of this accessible in its parent's list of children,
99 * or -1 if this accessible does not have a parent.
101 readonly attribute long indexInParent;
104 * Accessible name -- the main text equivalent for this node. The name is
105 * specified by ARIA or by native markup. Example of ARIA markup is
106 * aria-labelledby attribute placed on element of this accessible. Example
107 * of native markup is HTML label linked with HTML element of this accessible.
109 * Value can be string or null. A null value indicates that AT may attempt to
110 * compute the name. Any string value, including the empty string, should be
111 * considered author-intentional, and respected.
113 attribute AString name;
116 * Accessible value -- a number or a secondary text equivalent for this node
117 * Widgets that use role attribute can force a value using the valuenow attribute
119 readonly attribute AString value;
122 * Accessible description -- long text associated with this node
124 readonly attribute AString description;
127 * Provides localized string of accesskey name, such as Alt+D.
128 * The modifier may be affected by user and platform preferences.
129 * Usually alt+letter, or just the letter alone for menu items.
131 readonly attribute AString keyboardShortcut;
134 * Provides localized string of global keyboard accelerator for default
135 * action, such as Ctrl+O for Open file
137 readonly attribute AString defaultKeyBinding;
140 * Provides array of localized string of global keyboard accelerator for
141 * the given action index supported by accessible.
143 * @param aActionIndex - index of the given action
145 nsIDOMDOMStringList getKeyBindings(in PRUint8 aActionIndex);
148 * Enumerated accessible role (see the constants defined in nsIAccessibleRole).
150 * @note The values might depend on platform because of variations. Widgets
151 * can use ARIA role attribute to force the final role.
153 readonly attribute unsigned long role;
156 * Accessible states -- bit fields which describe boolean properties of node.
157 * Many states are only valid given a certain role attribute that supports
158 * them.
160 * @param aState - the first bit field (see nsIAccessibleStates::STATE_*
161 * constants)
162 * @param aExtraState - the second bit field
163 * (see nsIAccessibleStates::EXT_STATE_* constants)
165 void getState(out unsigned long aState, out unsigned long aExtraState);
168 * Help text associated with node
170 readonly attribute AString help;
173 * Focused accessible child of node
175 readonly attribute nsIAccessible focusedChild;
178 * Attributes of accessible
180 readonly attribute nsIPersistentProperties attributes;
183 * Returns grouping information. Used for tree items, list items, tab panel
184 * labels, radio buttons, etc. Also used for collectons of non-text objects.
186 * @param groupLevel - 1-based, similar to ARIA 'level' property
187 * @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property,
188 * inclusive of the current item
189 * @param positionInGroup - 1-based, similar to ARIA 'posinset' property
191 void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup,
192 out long aPositionInGroup);
195 * Accessible child which contains the coordinate at (x, y) in screen pixels.
196 * If the point is in the current accessible but not in a child, the
197 * current accessible will be returned.
198 * If the point is in neither the current accessible or a child, then
199 * null will be returned.
201 * @param x screen's x coordinate
202 * @param y screen's y coordinate
203 * @return the deepest accessible child containing the given point
205 nsIAccessible getChildAtPoint(in long x, in long y);
208 * Deepest accessible child which contains the coordinate at (x, y) in screen
209 * pixels. If the point is in the current accessible but not in a child, the
210 * current accessible will be returned. If the point is in neither the current
211 * accessible or a child, then null will be returned.
213 * @param x screen's x coordinate
214 * @param y screen's y coordinate
215 * @return the deepest accessible child containing the given point
217 nsIAccessible getDeepestChildAtPoint(in long x, in long y);
220 * Nth accessible child using zero-based index or last child if index less than zero
222 nsIAccessible getChildAt(in long aChildIndex);
225 * Accessible node geometrically to the right of this one
227 nsIAccessible getAccessibleToRight();
230 * Accessible node geometrically to the left of this one
232 nsIAccessible getAccessibleToLeft();
235 * Accessible node geometrically above this one
237 nsIAccessible getAccessibleAbove();
240 * Accessible node geometrically below this one
242 nsIAccessible getAccessibleBelow();
245 * Return accessible relation by the given relation type (see.
246 * constants defined in nsIAccessibleRelation).
248 nsIAccessibleRelation getRelationByType(in unsigned long aRelationType);
251 * Returns the number of accessible relations for this object.
253 readonly attribute unsigned long relationsCount;
256 * Returns one accessible relation for this object.
258 * @param index - relation index (0-based)
260 nsIAccessibleRelation getRelation(in unsigned long index);
263 * Returns multiple accessible relations for this object.
265 nsIArray getRelations();
268 * Return accessible's x and y coordinates relative to the screen and
269 * accessible's width and height.
271 void getBounds(out long x, out long y, out long width, out long height);
274 * Add or remove this accessible to the current selection
276 void setSelected(in boolean isSelected);
279 * Extend the current selection from its current accessible anchor node
280 * to this accessible
282 void extendSelection();
285 * Select this accessible node only
287 void takeSelection();
290 * Focus this accessible node,
291 * The state STATE_FOCUSABLE indicates whether this node is normally focusable.
292 * It is the callers responsibility to determine whether this node is focusable.
293 * accTakeFocus on a node that is not normally focusable (such as a table),
294 * will still set focus on that node, although normally that will not be visually
295 * indicated in most style sheets.
297 void takeFocus();
300 * The number of accessible actions associated with this accessible
302 readonly attribute PRUint8 numActions;
305 * The name of the accessible action at the given zero-based index
307 AString getActionName(in PRUint8 index);
310 * The description of the accessible action at the given zero-based index
312 AString getActionDescription(in PRUint8 aIndex);
315 * Perform the accessible action at the given zero-based index
316 * Action number 0 is the default action
318 void doAction(in PRUint8 index);
321 * Get a pointer to accessibility interface for this node, which is specific
322 * to the OS/accessibility toolkit we're running on.
324 [noscript] void getNativeInterface(out voidPtr aOutAccessible);