michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsIArray.idl" michael@0: michael@0: interface nsIPersistentProperties; michael@0: interface nsIDOMCSSPrimitiveValue; michael@0: interface nsIDOMNode; michael@0: interface nsIAccessibleDocument; michael@0: interface nsIAccessibleRelation; michael@0: michael@0: /** michael@0: * A cross-platform interface that supports platform-specific michael@0: * accessibility APIs like MSAA and ATK. Contains the sum of what's needed michael@0: * to support IAccessible as well as ATK's generic accessibility objects. michael@0: * Can also be used by in-process accessibility clients to get information michael@0: * about objects in the accessible tree. The accessible tree is a subset of michael@0: * nodes in the DOM tree -- such as documents, focusable elements and text. michael@0: * Mozilla creates the implementations of nsIAccessible on demand. michael@0: * See http://www.mozilla.org/projects/ui/accessibility for more information. michael@0: */ michael@0: [scriptable, uuid(ee62158b-bb83-424b-a88d-d7d7f9cf460d)] michael@0: interface nsIAccessible : nsISupports michael@0: { michael@0: /** michael@0: * Parent node in accessible tree. michael@0: */ michael@0: readonly attribute nsIAccessible parent; michael@0: michael@0: /** michael@0: * Next sibling in accessible tree michael@0: */ michael@0: readonly attribute nsIAccessible nextSibling; michael@0: michael@0: /** michael@0: * Previous sibling in accessible tree michael@0: */ michael@0: readonly attribute nsIAccessible previousSibling; michael@0: michael@0: /** michael@0: * First child in accessible tree michael@0: */ michael@0: readonly attribute nsIAccessible firstChild; michael@0: michael@0: /** michael@0: * Last child in accessible tree michael@0: */ michael@0: readonly attribute nsIAccessible lastChild; michael@0: michael@0: /** michael@0: * Array of all this element's children. michael@0: */ michael@0: readonly attribute nsIArray children; michael@0: michael@0: /** michael@0: * Number of accessible children michael@0: */ michael@0: readonly attribute long childCount; michael@0: michael@0: /** michael@0: * The 0-based index of this accessible in its parent's list of children, michael@0: * or -1 if this accessible does not have a parent. michael@0: */ michael@0: readonly attribute long indexInParent; michael@0: michael@0: /** michael@0: * The DOM node this nsIAccessible is associated with. michael@0: */ michael@0: readonly attribute nsIDOMNode DOMNode; michael@0: michael@0: /** michael@0: * The document accessible that this access node resides in. michael@0: */ michael@0: readonly attribute nsIAccessibleDocument document; michael@0: michael@0: /** michael@0: * The root document accessible that this access node resides in. michael@0: */ michael@0: readonly attribute nsIAccessibleDocument rootDocument; michael@0: michael@0: /** michael@0: * The language for the current DOM node, e.g. en, de, etc. michael@0: */ michael@0: readonly attribute DOMString language; michael@0: michael@0: /** michael@0: * Accessible name -- the main text equivalent for this node. The name is michael@0: * specified by ARIA or by native markup. Example of ARIA markup is michael@0: * aria-labelledby attribute placed on element of this accessible. Example michael@0: * of native markup is HTML label linked with HTML element of this accessible. michael@0: * michael@0: * Value can be string or null. A null value indicates that AT may attempt to michael@0: * compute the name. Any string value, including the empty string, should be michael@0: * considered author-intentional, and respected. michael@0: */ michael@0: attribute AString name; michael@0: michael@0: /** michael@0: * Accessible value -- a number or a secondary text equivalent for this node michael@0: * Widgets that use role attribute can force a value using the valuenow attribute michael@0: */ michael@0: readonly attribute AString value; michael@0: michael@0: /** michael@0: * Accessible description -- long text associated with this node michael@0: */ michael@0: readonly attribute AString description; michael@0: michael@0: /** michael@0: * Provides localized string of accesskey name, such as Alt+D. michael@0: * The modifier may be affected by user and platform preferences. michael@0: * Usually alt+letter, or just the letter alone for menu items. michael@0: */ michael@0: readonly attribute AString accessKey; michael@0: michael@0: /** michael@0: * Provides localized string of global keyboard accelerator for default michael@0: * action, such as Ctrl+O for Open file michael@0: */ michael@0: readonly attribute AString keyboardShortcut; michael@0: michael@0: /** michael@0: * Enumerated accessible role (see the constants defined in nsIAccessibleRole). michael@0: * michael@0: * @note The values might depend on platform because of variations. Widgets michael@0: * can use ARIA role attribute to force the final role. michael@0: */ michael@0: readonly attribute unsigned long role; michael@0: michael@0: /** michael@0: * Accessible states -- bit fields which describe boolean properties of node. michael@0: * Many states are only valid given a certain role attribute that supports michael@0: * them. michael@0: * michael@0: * @param aState - the first bit field (see nsIAccessibleStates::STATE_* michael@0: * constants) michael@0: * @param aExtraState - the second bit field michael@0: * (see nsIAccessibleStates::EXT_STATE_* constants) michael@0: */ michael@0: void getState(out unsigned long aState, out unsigned long aExtraState); michael@0: michael@0: /** michael@0: * Help text associated with node michael@0: */ michael@0: readonly attribute AString help; michael@0: michael@0: /** michael@0: * Focused accessible child of node michael@0: */ michael@0: readonly attribute nsIAccessible focusedChild; michael@0: michael@0: /** michael@0: * Attributes of accessible michael@0: */ michael@0: readonly attribute nsIPersistentProperties attributes; michael@0: michael@0: /** michael@0: * Returns grouping information. Used for tree items, list items, tab panel michael@0: * labels, radio buttons, etc. Also used for collectons of non-text objects. michael@0: * michael@0: * @param groupLevel - 1-based, similar to ARIA 'level' property michael@0: * @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property, michael@0: * inclusive of the current item michael@0: * @param positionInGroup - 1-based, similar to ARIA 'posinset' property michael@0: */ michael@0: [binaryname(ScriptableGroupPosition)] michael@0: void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup, michael@0: out long aPositionInGroup); michael@0: michael@0: /** michael@0: * Accessible child which contains the coordinate at (x, y) in screen pixels. michael@0: * If the point is in the current accessible but not in a child, the michael@0: * current accessible will be returned. michael@0: * If the point is in neither the current accessible or a child, then michael@0: * null will be returned. michael@0: * michael@0: * @param x screen's x coordinate michael@0: * @param y screen's y coordinate michael@0: * @return the deepest accessible child containing the given point michael@0: */ michael@0: nsIAccessible getChildAtPoint(in long x, in long y); michael@0: michael@0: /** michael@0: * Deepest accessible child which contains the coordinate at (x, y) in screen michael@0: * pixels. If the point is in the current accessible but not in a child, the michael@0: * current accessible will be returned. If the point is in neither the current michael@0: * accessible or a child, then null will be returned. michael@0: * michael@0: * @param x screen's x coordinate michael@0: * @param y screen's y coordinate michael@0: * @return the deepest accessible child containing the given point michael@0: */ michael@0: nsIAccessible getDeepestChildAtPoint(in long x, in long y); michael@0: michael@0: /** michael@0: * Nth accessible child using zero-based index or last child if index less than zero michael@0: */ michael@0: nsIAccessible getChildAt(in long aChildIndex); michael@0: michael@0: /** michael@0: * Return accessible relation by the given relation type (see. michael@0: * constants defined in nsIAccessibleRelation). michael@0: */ michael@0: nsIAccessibleRelation getRelationByType(in unsigned long aRelationType); michael@0: michael@0: /** michael@0: * Returns multiple accessible relations for this object. michael@0: */ michael@0: nsIArray getRelations(); michael@0: michael@0: /** michael@0: * Return accessible's x and y coordinates relative to the screen and michael@0: * accessible's width and height. michael@0: */ michael@0: void getBounds(out long x, out long y, out long width, out long height); michael@0: michael@0: /** michael@0: * Add or remove this accessible to the current selection michael@0: */ michael@0: void setSelected(in boolean isSelected); michael@0: michael@0: /** michael@0: * Extend the current selection from its current accessible anchor node michael@0: * to this accessible michael@0: */ michael@0: void extendSelection(); michael@0: michael@0: /** michael@0: * Select this accessible node only michael@0: */ michael@0: void takeSelection(); michael@0: michael@0: /** michael@0: * Focus this accessible node, michael@0: * The state STATE_FOCUSABLE indicates whether this node is normally focusable. michael@0: * It is the callers responsibility to determine whether this node is focusable. michael@0: * accTakeFocus on a node that is not normally focusable (such as a table), michael@0: * will still set focus on that node, although normally that will not be visually michael@0: * indicated in most style sheets. michael@0: */ michael@0: void takeFocus(); michael@0: michael@0: /** michael@0: * The number of accessible actions associated with this accessible michael@0: */ michael@0: readonly attribute uint8_t actionCount; michael@0: michael@0: /** michael@0: * The name of the accessible action at the given zero-based index michael@0: */ michael@0: AString getActionName(in uint8_t index); michael@0: michael@0: /** michael@0: * The description of the accessible action at the given zero-based index michael@0: */ michael@0: AString getActionDescription(in uint8_t aIndex); michael@0: michael@0: /** michael@0: * Perform the accessible action at the given zero-based index michael@0: * Action number 0 is the default action michael@0: */ michael@0: void doAction(in uint8_t index); michael@0: michael@0: /** michael@0: * Makes an object visible on screen. michael@0: * michael@0: * @param scrollType - defines where the object should be placed on michael@0: * the screen (see nsIAccessibleScrollType for michael@0: * available constants). michael@0: */ michael@0: void scrollTo(in unsigned long aScrollType); michael@0: michael@0: /** michael@0: * Moves the top left of an object to a specified location. michael@0: * michael@0: * @param coordinateType [in] - specifies whether the coordinates are relative to michael@0: * the screen or the parent object (for available michael@0: * constants refer to nsIAccessibleCoordinateType) michael@0: * @param x [in] - defines the x coordinate michael@0: * @param y [in] - defines the y coordinate michael@0: */ michael@0: void scrollToPoint(in unsigned long coordinateType, in long x, in long y); michael@0: michael@0: /** michael@0: * Get a pointer to accessibility interface for this node, which is specific michael@0: * to the OS/accessibility toolkit we're running on. michael@0: */ michael@0: [noscript] void getNativeInterface(out voidPtr aOutAccessible); michael@0: }; michael@0: