tor-browser

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

nsIScriptableContentIterator.idl (2363B)


      1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
      2 /* This Source Code Form is subject to the terms of the Mozilla Public
      3 * License, v. 2.0. If a copy of the MPL was not distributed with this
      4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      5 
      6 #include "nsISupports.idl"
      7 
      8 webidl Node;
      9 webidl Range;
     10 
     11 /**
     12 * nsIScriptableContentIterator is designed to testing concrete classes of
     13 * ContentIteratorBase.
     14 */
     15 [scriptable, builtinclass, uuid(9f25fb2a-265f-44f9-a122-62bbf443239e)]
     16 interface nsIScriptableContentIterator : nsISupports
     17 {
     18  cenum IteratorType : 8 {
     19    NOT_INITIALIZED,
     20    POST_ORDER_ITERATOR,
     21    PRE_ORDER_ITERATOR,
     22    SUBTREE_ITERATOR
     23  };
     24 
     25  /**
     26   * You need to call initWith*() first.  Then, the instance of this interface
     27   * decides the type of iterator with its aType argument.  You can call
     28   * initWith*() multiple times, but you need to keep setting same type as
     29   * previous call.  If you set different type, these method with throw an
     30   * exception.
     31   */
     32 
     33  // See ContentIteratorBase::Init(nsINode*)
     34  void initWithRootNode(in nsIScriptableContentIterator_IteratorType aType,
     35                        in Node aRoot);
     36 
     37  // See ContentIteratorBase::Init(nsRange*)
     38  void initWithRange(in nsIScriptableContentIterator_IteratorType aType,
     39                     in Range aRange);
     40 
     41  // See ContentSubtreeIterator::InitWithAllowCrossShadowBoundary(nsRange*)
     42  void initWithRangeAllowCrossShadowBoundary(
     43                     in nsIScriptableContentIterator_IteratorType aType,
     44                     in Range aRange);
     45 
     46  // See ContentIteratorBase::Init(nsINode*, uint32_t, nsINode*, uint32_t)
     47  void initWithPositions(in nsIScriptableContentIterator_IteratorType aType,
     48                         in Node aStartContainer, in unsigned long aStartOffset,
     49                         in Node aEndContainer, in unsigned long aEndOffset);
     50 
     51  // See ContentIteratorBase::First()
     52  void first();
     53 
     54  // See ContentIteratorBase::Last()
     55  void last();
     56 
     57  // See ContentIteratorBase::Next()
     58  void next();
     59 
     60  // See ContentIteratorBase::Prev()
     61  void prev();
     62 
     63  // See ContentIteratorBase::GetCurrentNode()
     64  readonly attribute Node currentNode;
     65 
     66  // See ContentIteratorBase::IsDone()
     67  readonly attribute boolean isDone;
     68 
     69  // See ContentIteratorBase::PositionAt(nsINode*)
     70  void positionAt(in Node aNode);
     71 };