accessible/public/nsIAccessible.idl

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/accessible/public/nsIAccessible.idl	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,293 @@
     1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#include "nsISupports.idl"
    1.10 +#include "nsIArray.idl"
    1.11 +
    1.12 +interface nsIPersistentProperties;
    1.13 +interface nsIDOMCSSPrimitiveValue;
    1.14 +interface nsIDOMNode;
    1.15 +interface nsIAccessibleDocument;
    1.16 +interface nsIAccessibleRelation;
    1.17 +
    1.18 +/**
    1.19 + * A cross-platform interface that supports platform-specific 
    1.20 + * accessibility APIs like MSAA and ATK. Contains the sum of what's needed
    1.21 + * to support IAccessible as well as ATK's generic accessibility objects.
    1.22 + * Can also be used by in-process accessibility clients to get information
    1.23 + * about objects in the accessible tree. The accessible tree is a subset of 
    1.24 + * nodes in the DOM tree -- such as documents, focusable elements and text.
    1.25 + * Mozilla creates the implementations of nsIAccessible on demand.
    1.26 + * See http://www.mozilla.org/projects/ui/accessibility for more information.
    1.27 + */
    1.28 +[scriptable, uuid(ee62158b-bb83-424b-a88d-d7d7f9cf460d)]
    1.29 +interface nsIAccessible : nsISupports
    1.30 +{
    1.31 +  /**
    1.32 +   * Parent node in accessible tree.
    1.33 +   */
    1.34 +  readonly attribute nsIAccessible parent;
    1.35 +
    1.36 +  /**
    1.37 +   * Next sibling in accessible tree
    1.38 +   */
    1.39 +  readonly attribute nsIAccessible nextSibling;
    1.40 +
    1.41 +  /**
    1.42 +   * Previous sibling in accessible tree
    1.43 +   */
    1.44 +  readonly attribute nsIAccessible previousSibling;
    1.45 +
    1.46 +  /**
    1.47 +   * First child in accessible tree
    1.48 +   */
    1.49 +  readonly attribute nsIAccessible firstChild;
    1.50 +
    1.51 +  /**
    1.52 +   * Last child in accessible tree
    1.53 +   */
    1.54 +  readonly attribute nsIAccessible lastChild;
    1.55 +  
    1.56 +  /**
    1.57 +   * Array of all this element's children.
    1.58 +   */
    1.59 +  readonly attribute nsIArray children;
    1.60 +
    1.61 +  /**
    1.62 +   * Number of accessible children
    1.63 +   */
    1.64 +  readonly attribute long childCount;
    1.65 +
    1.66 +  /**
    1.67 +   * The 0-based index of this accessible in its parent's list of children,
    1.68 +   * or -1 if this accessible does not have a parent.
    1.69 +   */
    1.70 +  readonly attribute long indexInParent;
    1.71 +
    1.72 +  /**
    1.73 +   * The DOM node this nsIAccessible is associated with.
    1.74 +   */
    1.75 +  readonly attribute nsIDOMNode DOMNode;
    1.76 +
    1.77 +  /**
    1.78 +   * The document accessible that this access node resides in.
    1.79 +   */
    1.80 +  readonly attribute nsIAccessibleDocument document;
    1.81 +
    1.82 +  /**
    1.83 +   * The root document accessible that this access node resides in.
    1.84 +   */
    1.85 +  readonly attribute nsIAccessibleDocument rootDocument;
    1.86 +
    1.87 +  /**
    1.88 +   * The language for the current DOM node, e.g. en, de, etc.
    1.89 +   */
    1.90 +  readonly attribute DOMString language;
    1.91 +
    1.92 +  /**
    1.93 +   * Accessible name -- the main text equivalent for this node. The name is
    1.94 +   * specified by ARIA or by native markup. Example of ARIA markup is
    1.95 +   * aria-labelledby attribute placed on element of this accessible. Example
    1.96 +   * of native markup is HTML label linked with HTML element of this accessible.
    1.97 +   *
    1.98 +   * Value can be string or null. A null value indicates that AT may attempt to
    1.99 +   * compute the name. Any string value, including the empty string, should be
   1.100 +   * considered author-intentional, and respected.
   1.101 +   */
   1.102 +  attribute AString name;
   1.103 +
   1.104 +  /**
   1.105 +   * Accessible value -- a number or a secondary text equivalent for this node
   1.106 +   * Widgets that use role attribute can force a value using the valuenow attribute
   1.107 +   */
   1.108 +  readonly attribute AString value;
   1.109 +
   1.110 +  /**
   1.111 +   * Accessible description -- long text associated with this node
   1.112 +   */
   1.113 +  readonly attribute AString description;
   1.114 +
   1.115 +  /**
   1.116 +   * Provides localized string of accesskey name, such as Alt+D.
   1.117 +   * The modifier may be affected by user and platform preferences.
   1.118 +   * Usually alt+letter, or just the letter alone for menu items. 
   1.119 +   */
   1.120 +  readonly attribute AString accessKey;
   1.121 +
   1.122 +  /**
   1.123 +   * Provides localized string of global keyboard accelerator for default
   1.124 +   * action, such as Ctrl+O for Open file
   1.125 +   */
   1.126 +  readonly attribute AString keyboardShortcut;
   1.127 +
   1.128 +  /**
   1.129 +   * Enumerated accessible role (see the constants defined in nsIAccessibleRole).
   1.130 +   *
   1.131 +   * @note  The values might depend on platform because of variations. Widgets
   1.132 +   *        can use ARIA role attribute to force the final role.
   1.133 +   */
   1.134 +  readonly attribute unsigned long role;
   1.135 +
   1.136 +  /**
   1.137 +   * Accessible states -- bit fields which describe boolean properties of node.
   1.138 +   * Many states are only valid given a certain role attribute that supports
   1.139 +   * them.
   1.140 +   *
   1.141 +   * @param aState - the first bit field (see nsIAccessibleStates::STATE_*
   1.142 +   *                 constants)
   1.143 +   * @param aExtraState - the second bit field
   1.144 +   *                      (see nsIAccessibleStates::EXT_STATE_* constants)
   1.145 +   */
   1.146 +  void getState(out unsigned long aState, out unsigned long aExtraState);
   1.147 +
   1.148 +  /**
   1.149 +   * Help text associated with node
   1.150 +   */
   1.151 +  readonly attribute AString help;
   1.152 +
   1.153 +  /**
   1.154 +   * Focused accessible child of node
   1.155 +   */
   1.156 +  readonly attribute nsIAccessible focusedChild;
   1.157 +
   1.158 +  /**
   1.159 +   * Attributes of accessible
   1.160 +   */
   1.161 +  readonly attribute nsIPersistentProperties attributes;
   1.162 +
   1.163 +  /**
   1.164 +   * Returns grouping information. Used for tree items, list items, tab panel
   1.165 +   * labels, radio buttons, etc. Also used for collectons of non-text objects.
   1.166 +   *
   1.167 +   * @param groupLevel - 1-based, similar to ARIA 'level' property
   1.168 +   * @param similarItemsInGroup - 1-based, similar to ARIA 'setsize' property,
   1.169 +   *                              inclusive of the current item
   1.170 +   * @param positionInGroup - 1-based, similar to ARIA 'posinset' property
   1.171 +   */
   1.172 +  [binaryname(ScriptableGroupPosition)]
   1.173 +  void groupPosition(out long aGroupLevel, out long aSimilarItemsInGroup,
   1.174 +                     out long aPositionInGroup);
   1.175 +
   1.176 +  /**
   1.177 +   * Accessible child which contains the coordinate at (x, y) in screen pixels.
   1.178 +   * If the point is in the current accessible but not in a child, the
   1.179 +   * current accessible will be returned.
   1.180 +   * If the point is in neither the current accessible or a child, then
   1.181 +   * null will be returned.
   1.182 +   *
   1.183 +   * @param x  screen's x coordinate
   1.184 +   * @param y  screen's y coordinate
   1.185 +   * @return   the deepest accessible child containing the given point
   1.186 +   */
   1.187 +  nsIAccessible getChildAtPoint(in long x, in long y);
   1.188 +
   1.189 +  /**
   1.190 +   * Deepest accessible child which contains the coordinate at (x, y) in screen
   1.191 +   * pixels. If the point is in the current accessible but not in a child, the
   1.192 +   * current accessible will be returned. If the point is in neither the current
   1.193 +   * accessible or a child, then null will be returned.
   1.194 +   *
   1.195 +   * @param x  screen's x coordinate
   1.196 +   * @param y  screen's y coordinate
   1.197 +   * @return   the deepest accessible child containing the given point
   1.198 +   */
   1.199 +  nsIAccessible getDeepestChildAtPoint(in long x, in long y);
   1.200 +
   1.201 +  /**
   1.202 +   * Nth accessible child using zero-based index or last child if index less than zero
   1.203 +   */
   1.204 +  nsIAccessible getChildAt(in long aChildIndex);
   1.205 +
   1.206 +  /**
   1.207 +   * Return accessible relation by the given relation type (see.
   1.208 +   * constants defined in nsIAccessibleRelation).
   1.209 +   */
   1.210 +  nsIAccessibleRelation getRelationByType(in unsigned long aRelationType);
   1.211 +
   1.212 +  /**
   1.213 +   * Returns multiple accessible relations for this object.
   1.214 +   */
   1.215 +  nsIArray getRelations();
   1.216 +
   1.217 +  /**
   1.218 +   * Return accessible's x and y coordinates relative to the screen and
   1.219 +   * accessible's width and height.
   1.220 +   */
   1.221 +  void getBounds(out long x, out long y, out long width, out long height);
   1.222 +
   1.223 +  /**
   1.224 +   * Add or remove this accessible to the current selection
   1.225 +   */
   1.226 +  void setSelected(in boolean isSelected);
   1.227 +
   1.228 +  /**
   1.229 +   * Extend the current selection from its current accessible anchor node
   1.230 +   * to this accessible
   1.231 +   */
   1.232 +  void extendSelection();
   1.233 +
   1.234 +  /**
   1.235 +   * Select this accessible node only
   1.236 +   */
   1.237 +  void takeSelection();
   1.238 +
   1.239 +  /**
   1.240 +   * Focus this accessible node,
   1.241 +   * The state STATE_FOCUSABLE indicates whether this node is normally focusable.
   1.242 +   * It is the callers responsibility to determine whether this node is focusable.
   1.243 +   * accTakeFocus on a node that is not normally focusable (such as a table),
   1.244 +   * will still set focus on that node, although normally that will not be visually 
   1.245 +   * indicated in most style sheets.
   1.246 +   */
   1.247 +  void takeFocus();
   1.248 +
   1.249 +  /**
   1.250 +   * The number of accessible actions associated with this accessible
   1.251 +   */
   1.252 +  readonly attribute uint8_t actionCount;
   1.253 +
   1.254 +  /**
   1.255 +   * The name of the accessible action at the given zero-based index
   1.256 +   */
   1.257 +  AString getActionName(in uint8_t index);
   1.258 +
   1.259 +  /**
   1.260 +   * The description of the accessible action at the given zero-based index
   1.261 +   */
   1.262 +  AString getActionDescription(in uint8_t aIndex);
   1.263 +
   1.264 +  /**
   1.265 +   * Perform the accessible action at the given zero-based index
   1.266 +   * Action number 0 is the default action
   1.267 +   */
   1.268 +  void doAction(in uint8_t index);   
   1.269 +
   1.270 +  /**
   1.271 +   * Makes an object visible on screen.
   1.272 +   *
   1.273 +   * @param scrollType - defines where the object should be placed on
   1.274 +   *                     the screen (see nsIAccessibleScrollType for
   1.275 +   *                     available constants).
   1.276 +   */
   1.277 +  void scrollTo(in unsigned long aScrollType);
   1.278 +
   1.279 +  /**
   1.280 +   * Moves the top left of an object to a specified location.
   1.281 +   *
   1.282 +   * @param coordinateType [in] - specifies whether the coordinates are relative to
   1.283 +   *                         the screen or the parent object (for available
   1.284 +   *                         constants refer to nsIAccessibleCoordinateType)
   1.285 +   * @param x [in] - defines the x coordinate
   1.286 +   * @param y [in] - defines the y coordinate
   1.287 +  */
   1.288 +  void scrollToPoint(in unsigned long coordinateType, in long x, in long y);
   1.289 +
   1.290 +  /**
   1.291 +   * Get a pointer to accessibility interface for this node, which is specific 
   1.292 +   * to the OS/accessibility toolkit we're running on.
   1.293 +   */
   1.294 +  [noscript] void getNativeInterface(out voidPtr aOutAccessible);
   1.295 +};
   1.296 +

mercurial