Line data Source code
1 : /* -*- Mode: C++; 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 : #ifndef NSIFRAMETRAVERSAL_H
6 : #define NSIFRAMETRAVERSAL_H
7 :
8 : #include "nsISupports.h"
9 : #include "nsIFrame.h"
10 :
11 : #define NS_IFRAMEENUMERATOR_IID \
12 : { 0x7c633f5d, 0x91eb, 0x494e, \
13 : { 0xa1, 0x40, 0x17, 0x46, 0x17, 0x4c, 0x23, 0xd3 } }
14 :
15 0 : class nsIFrameEnumerator : public nsISupports
16 : {
17 : public:
18 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMEENUMERATOR_IID)
19 :
20 : virtual void First() = 0;
21 : virtual void Next() = 0;
22 : virtual nsIFrame* CurrentItem() = 0;
23 : virtual bool IsDone() = 0;
24 :
25 : virtual void Last() = 0;
26 : virtual void Prev() = 0;
27 : };
28 :
29 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameEnumerator, NS_IFRAMEENUMERATOR_IID)
30 :
31 : enum nsIteratorType {
32 : eLeaf,
33 : ePreOrder,
34 : ePostOrder
35 : };
36 :
37 : // {d33fe76c-207c-4359-a315-8eb1eecf80e5}
38 : #define NS_IFRAMETRAVERSAL_IID \
39 : { 0xd33fe76c, 0x207c, 0x4359, { 0xa3, 0x15, 0x8e, 0xb1, 0xee, 0xcf, 0x80, 0xe5 } }
40 :
41 0 : class nsIFrameTraversal : public nsISupports
42 : {
43 : public:
44 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_IFRAMETRAVERSAL_IID)
45 :
46 : /**
47 : * Create a frame iterator with the specified properties.
48 : * @param aEnumerator [out] the created iterator
49 : * @param aPresContext [in]
50 : * @param aStart [in] the frame to start iterating from
51 : * @param aType [in] the type of the iterator: leaf, pre-order, or post-order
52 : * @param aVisual [in] whether the iterator should traverse frames in visual
53 : * bidi order
54 : * @param aLockInScrollView [in] whether to stop iterating when exiting a
55 : * scroll view
56 : * @param aFollowOOFs [in] whether the iterator should follow out-of-flows.
57 : * If true, when reaching a placeholder frame while going down will get
58 : * the real frame. Going back up will go on past the placeholder,
59 : * so the placeholders are logically part of the frame tree.
60 : * @param aSkipPopupChecks [in] if false, then don't iterate into or out of a
61 : * popup frame. If true, skip any popup related checks.
62 : */
63 : NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
64 : nsPresContext* aPresContext,
65 : nsIFrame *aStart,
66 : int32_t aType,
67 : bool aVisual,
68 : bool aLockInScrollView,
69 : bool aFollowOOFs,
70 : bool aSkipPopupChecks) = 0;
71 : };
72 :
73 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameTraversal, NS_IFRAMETRAVERSAL_IID)
74 :
75 : #endif //NSIFRAMETRAVERSAL_H
|