tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

nsIAccessiblePivot.idl (3841B)


      1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* vim: set ts=2 et sw=2 tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #include "nsISupports.idl"
      8 
      9 typedef short PivotMoveReason;
     10 
     11 interface nsIAccessible;
     12 interface nsIAccessibleTraversalRule;
     13 
     14 /**
     15 * The pivot interface encapsulates a reference to a single place in an accessible
     16 * subtree. The pivot is a point or a range in the accessible tree. This interface
     17 * provides traversal methods to move the pivot to next/prev state that complies
     18 * to a given rule.
     19 */
     20 [scriptable, uuid(81fe5144-059b-42db-bd3a-f6ce3158d5e9)]
     21 interface nsIAccessiblePivot : nsISupports
     22 {
     23  /**
     24   * Move pivot to next object, from current position or given anchor,
     25   * complying to given traversal rule.
     26   *
     27   * @param aRule            [in] traversal rule to use.
     28   * @param aAnchor          [in] accessible to start search from, if not provided,
     29   *                           current position will be used.
     30   * @param aIncludeStart    [in] include anchor accessible in search.
     31   * @return next accessible node that matches rule in preorder.
     32   */
     33  [optional_argc] nsIAccessible next(in nsIAccessible aAnchor,
     34                                     in nsIAccessibleTraversalRule aRule,
     35                                     [optional] in boolean aIncludeStart);
     36 
     37  /**
     38   * Move pivot to previous object, from current position or given anchor,
     39   * complying to given traversal rule.
     40   *
     41   * @param aRule            [in] traversal rule to use.
     42   * @param aAnchor          [in] accessible to start search from, if not provided,
     43   *                           current position will be used.
     44   * @param aIncludeStart    [in] include anchor accessible in search.
     45   * @return previous accessible node that matches rule in preorder.
     46   */
     47  [optional_argc] nsIAccessible prev(in nsIAccessible aAnchor,
     48                                     in nsIAccessibleTraversalRule aRule,
     49                                     [optional] in boolean aIncludeStart);
     50 
     51  /**
     52   * Move pivot to first object in subtree complying to given traversal rule.
     53   *
     54   * @param aRule            [in] traversal rule to use.
     55   * @return first accessible node in subtree that matches rule in preorder.
     56   */
     57  nsIAccessible first(in nsIAccessibleTraversalRule aRule);
     58 
     59  /**
     60   * Move pivot to last object in subtree complying to given traversal rule.
     61   *
     62   * @param aRule            [in] traversal rule to use.
     63   * @return last accessible node in subtree that matches rule in preorder.
     64   */
     65  nsIAccessible last(in nsIAccessibleTraversalRule aRule);
     66 
     67  /**
     68   * Move pivot to given coordinate in screen pixels.
     69   *
     70   * @param aX               [in]  screen's x coordinate
     71   * @param aY               [in]  screen's y coordinate
     72   * @param aRule            [in]  raversal rule to use.
     73   * @return highest accessible in subtree that matches rule at given point.
     74   */
     75  nsIAccessible atPoint(in long aX, in long aY,
     76                        in nsIAccessibleTraversalRule aRule);
     77 };
     78 
     79 [scriptable, uuid(e197460d-1eff-4247-b4bb-a43be1840dae)]
     80 interface nsIAccessibleTraversalRule : nsISupports
     81 {
     82  /* Ignore this accessible object */
     83  const unsigned short FILTER_IGNORE = 0x0;
     84  /* Accept this accessible object */
     85  const unsigned short FILTER_MATCH = 0x1;
     86  /* Don't traverse accessibles children */
     87  const unsigned short FILTER_IGNORE_SUBTREE = 0x2;
     88 
     89  /**
     90   * Determines if a given accessible is to be accepted in our traversal rule
     91   *
     92   * @param aAccessible [in] accessible to examine.
     93   * @return a bitfield of FILTER_MATCH and FILTER_IGNORE_SUBTREE.
     94   */
     95  unsigned short match(in nsIAccessible aAccessible);
     96 };