2001-02-14 23:51:33 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
2003-07-09 11:01:46 +04:00
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
|
|
|
*
|
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
|
|
|
* The Initial Developer of the Original Code is
|
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 2003
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
2001-02-14 23:51:33 +03:00
|
|
|
*
|
2001-03-28 04:49:05 +04:00
|
|
|
* Original Author: Eric D Vaughan (evaughan@netscape.com)
|
2003-07-09 11:01:46 +04:00
|
|
|
* Contributor(s): Aaron Leventhal (aaronl@netscape.com)
|
|
|
|
* John Gaunt (jgaunt@netscape.com)
|
2003-07-22 18:55:22 +04:00
|
|
|
* Kyle Yuan (kyle.yuan@sun.com)
|
2006-09-06 18:29:56 +04:00
|
|
|
* Håkan Waara (hwaara@gmail.com)
|
2003-07-09 11:01:46 +04:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
|
|
|
* either the GNU General Public License Version 2 or later (the "GPL"), or
|
|
|
|
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
2001-02-14 23:51:33 +03:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
2006-09-06 18:29:56 +04:00
|
|
|
#include "nsIArray.idl"
|
|
|
|
|
2006-09-01 01:07:41 +04:00
|
|
|
interface nsIPersistentProperties;
|
2007-03-08 18:25:35 +03:00
|
|
|
interface nsIDOMDOMStringList;
|
2007-05-20 06:41:33 +04:00
|
|
|
interface nsIAccessibleRelation;
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* A cross-platform interface that supports platform-specific
|
|
|
|
* accessibility APIs like MSAA and ATK. Contains the sum of what's needed
|
|
|
|
* to support IAccessible as well as ATK's generic accessibility objects.
|
|
|
|
* Can also be used by in-process accessibility clients to get information
|
|
|
|
* about objects in the accessible tree. The accessible tree is a subset of
|
|
|
|
* nodes in the DOM tree -- such as documents, focusable elements and text.
|
|
|
|
* Mozilla creates the implementations of nsIAccessible on demand.
|
|
|
|
* See http://www.mozilla.org/projects/ui/accessibility for more information.
|
|
|
|
*
|
|
|
|
* @status UNDER_REVIEW
|
|
|
|
*/
|
2009-03-07 18:38:58 +03:00
|
|
|
[scriptable, uuid(c81d8f8c-8585-4094-bc7c-71dd01494906)]
|
2001-02-14 23:51:33 +03:00
|
|
|
interface nsIAccessible : nsISupports
|
|
|
|
{
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* Parent node in accessible tree.
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute nsIAccessible parent;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Next sibling in accessible tree
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute nsIAccessible nextSibling;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Previous sibling in accessible tree
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute nsIAccessible previousSibling;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* First child in accessible tree
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute nsIAccessible firstChild;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Last child in accessible tree
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute nsIAccessible lastChild;
|
2006-09-06 18:29:56 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Array of all this element's children.
|
|
|
|
*/
|
|
|
|
readonly attribute nsIArray children;
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* Number of accessible children
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute long childCount;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
2004-07-16 00:45:59 +04:00
|
|
|
/**
|
|
|
|
* The 0-based index of this accessible in its parent's list of children,
|
|
|
|
* or -1 if this accessible does not have a parent.
|
|
|
|
*/
|
|
|
|
readonly attribute long indexInParent;
|
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
2008-12-16 19:13:49 +03:00
|
|
|
* Accessible name -- the main text equivalent for this node. The name is
|
|
|
|
* specified by ARIA or by native markup. Example of ARIA markup is
|
|
|
|
* aria-labelledby attribute placed on element of this accessible. Example
|
|
|
|
* of native markup is HTML label linked with HTML element of this accessible.
|
|
|
|
*
|
|
|
|
* Value can be string or null. A null value indicates that AT may attempt to
|
|
|
|
* compute the name. Any string value, including the empty string, should be
|
|
|
|
* considered author-intentional, and respected.
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
attribute AString name;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible value -- a number or a secondary text equivalent for this node
|
2006-07-01 07:52:29 +04:00
|
|
|
* Widgets that use role attribute can force a value using the valuenow attribute
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2006-06-15 20:55:32 +04:00
|
|
|
readonly attribute AString value;
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* Accessible description -- long text associated with this node
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute AString description;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides localized string of accesskey name, such as Alt+D.
|
|
|
|
* The modifier may be affected by user and platform preferences.
|
|
|
|
* Usually alt+letter, or just the letter alone for menu items.
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute AString keyboardShortcut;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
2007-03-08 18:25:35 +03:00
|
|
|
* Provides localized string of global keyboard accelerator for default
|
|
|
|
* action, such as Ctrl+O for Open file
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2007-03-08 18:25:35 +03:00
|
|
|
readonly attribute AString defaultKeyBinding;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Provides array of localized string of global keyboard accelerator for
|
2007-03-18 08:21:13 +03:00
|
|
|
* the given action index supported by accessible.
|
|
|
|
*
|
|
|
|
* @param aActionIndex - index of the given action
|
2007-03-08 18:25:35 +03:00
|
|
|
*/
|
2007-03-18 08:21:13 +03:00
|
|
|
nsIDOMDOMStringList getKeyBindings(in PRUint8 aActionIndex);
|
2002-05-09 00:43:49 +04:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
2009-03-07 18:38:58 +03:00
|
|
|
* Enumerated accessible role (see the constants defined in nsIAccessibleRole).
|
|
|
|
*
|
|
|
|
* @note The values might depend on platform because of variations. Widgets
|
|
|
|
* can use ARIA role attribute to force the final role.
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute unsigned long role;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
2007-04-02 19:56:24 +04:00
|
|
|
* Accessible states -- bit fields which describe boolean properties of node.
|
|
|
|
* Many states are only valid given a certain role attribute that supports
|
|
|
|
* them.
|
|
|
|
*
|
|
|
|
* @param aState - the first bit field (see nsIAccessibleStates::STATE_*
|
|
|
|
* constants)
|
|
|
|
* @param aExtraState - the second bit field
|
|
|
|
* (see nsIAccessibleStates::EXT_STATE_* constants)
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2008-11-04 06:37:46 +03:00
|
|
|
void getState(out unsigned long aState, out unsigned long aExtraState);
|
2007-03-23 02:01:14 +03:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* Help text associated with node
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute AString help;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Focused accessible child of node
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute nsIAccessible focusedChild;
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2006-09-01 01:07:41 +04:00
|
|
|
/**
|
|
|
|
* Attributes of accessible
|
|
|
|
*/
|
|
|
|
readonly attribute nsIPersistentProperties attributes;
|
|
|
|
|
2007-03-27 16:17:11 +04:00
|
|
|
/**
|
|
|
|
* Returns grouping information. Used for tree items, list items, tab panel
|
|
|
|
* labels, radio buttons, etc. Also used for collectons of non-text objects.
|
|
|
|
*
|
2007-04-17 09:13:24 +04:00
|
|
|
* @param groupLevel - 1-based, similar to ARIA 'level' property
|
2007-11-13 06:03:29 +03:00
|
|
|
* @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property,
|
|
|
|
* inclusive of the current item
|
2007-04-17 09:13:24 +04:00
|
|
|
* @param positionInGroup - 1-based, similar to ARIA 'posinset' property
|
2007-03-27 16:17:11 +04:00
|
|
|
*/
|
|
|
|
void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup,
|
|
|
|
out long aPositionInGroup);
|
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
2006-08-17 18:39:11 +04:00
|
|
|
* Accessible child which contains the coordinate at (x, y) in screen pixels.
|
2007-09-19 01:44:43 +04:00
|
|
|
* If the point is in the current accessible but not in a child, the
|
|
|
|
* current accessible will be returned.
|
|
|
|
* If the point is in neither the current accessible or a child, then
|
|
|
|
* null will be returned.
|
2008-09-17 17:11:39 +04:00
|
|
|
*
|
|
|
|
* @param x screen's x coordinate
|
|
|
|
* @param y screen's y coordinate
|
|
|
|
* @return the deepest accessible child containing the given point
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
nsIAccessible getChildAtPoint(in long x, in long y);
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2008-09-17 17:11:39 +04:00
|
|
|
/**
|
|
|
|
* Deepest accessible child which contains the coordinate at (x, y) in screen
|
|
|
|
* pixels. If the point is in the current accessible but not in a child, the
|
|
|
|
* current accessible will be returned. If the point is in neither the current
|
|
|
|
* accessible or a child, then null will be returned.
|
|
|
|
*
|
|
|
|
* @param x screen's x coordinate
|
|
|
|
* @param y screen's y coordinate
|
|
|
|
* @return the deepest accessible child containing the given point
|
|
|
|
*/
|
|
|
|
nsIAccessible getDeepestChildAtPoint(in long x, in long y);
|
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
2005-06-27 19:52:12 +04:00
|
|
|
* Nth accessible child using zero-based index or last child if index less than zero
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
|
|
|
nsIAccessible getChildAt(in long aChildIndex);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible node geometrically to the right of this one
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
nsIAccessible getAccessibleToRight();
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible node geometrically to the left of this one
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
nsIAccessible getAccessibleToLeft();
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible node geometrically above this one
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
nsIAccessible getAccessibleAbove();
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Accessible node geometrically below this one
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
nsIAccessible getAccessibleBelow();
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2005-06-24 20:29:15 +04:00
|
|
|
/**
|
2009-02-10 13:03:30 +03:00
|
|
|
* Return accessible relation by the given relation type (see.
|
2007-05-20 06:41:33 +04:00
|
|
|
* constants defined in nsIAccessibleRelation).
|
2005-06-24 20:29:15 +04:00
|
|
|
*/
|
2009-02-10 13:03:30 +03:00
|
|
|
nsIAccessibleRelation getRelationByType(in unsigned long aRelationType);
|
2005-06-24 20:29:15 +04:00
|
|
|
|
2007-05-20 06:41:33 +04:00
|
|
|
/**
|
|
|
|
* Returns the number of accessible relations for this object.
|
|
|
|
*/
|
|
|
|
readonly attribute unsigned long relationsCount;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns one accessible relation for this object.
|
|
|
|
*
|
|
|
|
* @param index - relation index (0-based)
|
|
|
|
*/
|
|
|
|
nsIAccessibleRelation getRelation(in unsigned long index);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Returns multiple accessible relations for this object.
|
|
|
|
*/
|
|
|
|
nsIArray getRelations();
|
|
|
|
|
2007-05-16 10:04:20 +04:00
|
|
|
/**
|
|
|
|
* Return accessible's x and y coordinates relative to the screen and
|
|
|
|
* accessible's width and height.
|
|
|
|
*/
|
|
|
|
void getBounds(out long x, out long y, out long width, out long height);
|
2001-02-14 23:51:33 +03:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
2006-06-15 22:29:44 +04:00
|
|
|
* Add or remove this accessible to the current selection
|
2003-07-22 18:55:22 +04:00
|
|
|
*/
|
2006-06-15 22:29:44 +04:00
|
|
|
void setSelected(in boolean isSelected);
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Extend the current selection from its current accessible anchor node
|
|
|
|
* to this accessible
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
void extendSelection();
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Select this accessible node only
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
void takeSelection();
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Focus this accessible node,
|
|
|
|
* The state STATE_FOCUSABLE indicates whether this node is normally focusable.
|
|
|
|
* It is the callers responsibility to determine whether this node is focusable.
|
|
|
|
* accTakeFocus on a node that is not normally focusable (such as a table),
|
|
|
|
* will still set focus on that node, although normally that will not be visually
|
|
|
|
* indicated in most style sheets.
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
void takeFocus();
|
2001-05-12 01:11:38 +04:00
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* The number of accessible actions associated with this accessible
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
readonly attribute PRUint8 numActions;
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The name of the accessible action at the given zero-based index
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
AString getActionName(in PRUint8 index);
|
2001-04-06 05:42:48 +04:00
|
|
|
|
2007-02-25 06:43:20 +03:00
|
|
|
/**
|
|
|
|
* The description of the accessible action at the given zero-based index
|
|
|
|
*/
|
|
|
|
AString getActionDescription(in PRUint8 aIndex);
|
|
|
|
|
2003-07-22 18:55:22 +04:00
|
|
|
/**
|
|
|
|
* Perform the accessible action at the given zero-based index
|
|
|
|
* Action number 0 is the default action
|
|
|
|
*/
|
2003-07-31 12:09:39 +04:00
|
|
|
void doAction(in PRUint8 index);
|
2003-07-22 18:55:22 +04:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get a pointer to accessibility interface for this node, which is specific
|
|
|
|
* to the OS/accessibility toolkit we're running on.
|
|
|
|
*/
|
2003-04-02 00:02:51 +04:00
|
|
|
[noscript] void getNativeInterface(out voidPtr aOutAccessible);
|
2007-03-23 02:01:14 +03:00
|
|
|
};
|
2007-05-20 06:41:33 +04:00
|
|
|
|