layout/base/nsIFrameTraversal.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/layout/base/nsIFrameTraversal.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,72 @@
     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 +#ifndef NSIFRAMETRAVERSAL_H
     1.9 +#define NSIFRAMETRAVERSAL_H
    1.10 +
    1.11 +#include "nsISupports.h"
    1.12 +#include "nsIFrame.h"
    1.13 +
    1.14 +#define NS_IFRAMEENUMERATOR_IID \
    1.15 +{ 0x7c633f5d, 0x91eb, 0x494e, \
    1.16 +  { 0xa1, 0x40, 0x17, 0x46, 0x17, 0x4c, 0x23, 0xd3 } }
    1.17 +
    1.18 +class nsIFrameEnumerator : public nsISupports
    1.19 +{
    1.20 +public:
    1.21 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEENUMERATOR_IID)
    1.22 +
    1.23 +  virtual void First() = 0;
    1.24 +  virtual void Next() = 0;
    1.25 +  virtual nsIFrame* CurrentItem() = 0;
    1.26 +  virtual bool IsDone() = 0;
    1.27 +
    1.28 +  virtual void Last() = 0;
    1.29 +  virtual void Prev() = 0;
    1.30 +};
    1.31 +
    1.32 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameEnumerator, NS_IFRAMEENUMERATOR_IID)
    1.33 +
    1.34 +enum nsIteratorType {
    1.35 +  eLeaf,
    1.36 +  ePreOrder,
    1.37 +  ePostOrder
    1.38 +};
    1.39 +
    1.40 +// {9d469828-9bf2-4151-a385-05f30219221b}
    1.41 +#define NS_IFRAMETRAVERSAL_IID \
    1.42 +{ 0x9d469828, 0x9bf2, 0x4151, { 0xa3, 0x85, 0x05, 0xf3, 0x02, 0x19, 0x22, 0x1b } }
    1.43 +
    1.44 +class nsIFrameTraversal : public nsISupports
    1.45 +{
    1.46 +public:
    1.47 +  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMETRAVERSAL_IID)
    1.48 +
    1.49 +  /**
    1.50 +   * Create a frame iterator with the specified properties.
    1.51 +   * @param aEnumerator [out] the created iterator
    1.52 +   * @param aPresContext [in]
    1.53 +   * @param aStart [in] the frame to start iterating from
    1.54 +   * @param aType [in] the type of the iterator: leaf, pre-order, or post-order
    1.55 +   * @param aVisual [in] whether the iterator should traverse frames in visual
    1.56 +   *        bidi order
    1.57 +   * @param aLockInScrollView [in] whether to stop iterating when exiting a
    1.58 +   *        scroll view
    1.59 +   * @param aFollowOOFs [in] whether the iterator should follow out-of-flows.
    1.60 +   *        If true, when reaching a placeholder frame while going down will get
    1.61 +   *        the real frame. Going back up will go on past the placeholder,
    1.62 +   *        so the placeholders are logically part of the frame tree.
    1.63 +   */
    1.64 +  NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
    1.65 +                               nsPresContext* aPresContext,
    1.66 +                               nsIFrame *aStart,
    1.67 +                               int32_t aType,
    1.68 +                               bool aVisual,
    1.69 +                               bool aLockInScrollView,
    1.70 +                               bool aFollowOOFs) = 0;
    1.71 +};
    1.72 +
    1.73 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameTraversal, NS_IFRAMETRAVERSAL_IID)
    1.74 +
    1.75 +#endif //NSIFRAMETRAVERSAL_H

mercurial