layout/base/nsIFrameTraversal.h

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:1dbe38fd2669
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 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 // {9d469828-9bf2-4151-a385-05f30219221b}
38 #define NS_IFRAMETRAVERSAL_IID \
39 { 0x9d469828, 0x9bf2, 0x4151, { 0xa3, 0x85, 0x05, 0xf3, 0x02, 0x19, 0x22, 0x1b } }
40
41 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 */
61 NS_IMETHOD NewFrameTraversal(nsIFrameEnumerator **aEnumerator,
62 nsPresContext* aPresContext,
63 nsIFrame *aStart,
64 int32_t aType,
65 bool aVisual,
66 bool aLockInScrollView,
67 bool aFollowOOFs) = 0;
68 };
69
70 NS_DEFINE_STATIC_IID_ACCESSOR(nsIFrameTraversal, NS_IFRAMETRAVERSAL_IID)
71
72 #endif //NSIFRAMETRAVERSAL_H

mercurial