|
1 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
2 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
4 |
|
5 #ifndef __inDeepTreeWalker_h___ |
|
6 #define __inDeepTreeWalker_h___ |
|
7 |
|
8 #include "inIDeepTreeWalker.h" |
|
9 |
|
10 #include "nsCOMPtr.h" |
|
11 #include "nsIDOMNode.h" |
|
12 #include "nsTArray.h" |
|
13 |
|
14 class inIDOMUtils; |
|
15 |
|
16 //////////////////////////////////////////////////// |
|
17 |
|
18 struct DeepTreeStackItem |
|
19 { |
|
20 nsCOMPtr<nsIDOMNode> node; |
|
21 nsCOMPtr<nsIDOMNodeList> kids; |
|
22 uint32_t lastIndex; // Index one bigger than the index of whatever |
|
23 // kid we're currently at in |kids|. |
|
24 }; |
|
25 |
|
26 //////////////////////////////////////////////////// |
|
27 |
|
28 class inDeepTreeWalker : public inIDeepTreeWalker |
|
29 { |
|
30 public: |
|
31 NS_DECL_ISUPPORTS |
|
32 NS_DECL_NSIDOMTREEWALKER |
|
33 NS_DECL_INIDEEPTREEWALKER |
|
34 |
|
35 inDeepTreeWalker(); |
|
36 virtual ~inDeepTreeWalker(); |
|
37 |
|
38 protected: |
|
39 void PushNode(nsIDOMNode* aNode); |
|
40 |
|
41 bool mShowAnonymousContent; |
|
42 bool mShowSubDocuments; |
|
43 nsCOMPtr<nsIDOMNode> mRoot; |
|
44 nsCOMPtr<nsIDOMNode> mCurrentNode; |
|
45 uint32_t mWhatToShow; |
|
46 |
|
47 nsAutoTArray<DeepTreeStackItem, 8> mStack; |
|
48 nsCOMPtr<inIDOMUtils> mDOMUtils; |
|
49 }; |
|
50 |
|
51 // {BFCB82C2-5611-4318-90D6-BAF4A7864252} |
|
52 #define IN_DEEPTREEWALKER_CID \ |
|
53 { 0xbfcb82c2, 0x5611, 0x4318, { 0x90, 0xd6, 0xba, 0xf4, 0xa7, 0x86, 0x42, 0x52 } } |
|
54 |
|
55 #endif // __inDeepTreeWalker_h___ |