1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef __inDeepTreeWalker_h___
8 #define __inDeepTreeWalker_h___
10 #include "inIDeepTreeWalker.h"
18 class inDeepTreeWalker final
: public inIDeepTreeWalker
{
21 NS_DECL_INIDEEPTREEWALKER
25 using ChildList
= AutoTArray
<RefPtr
<nsINode
>, 8>;
26 void GetChildren(nsINode
& aParent
, ChildList
&);
29 virtual ~inDeepTreeWalker();
31 already_AddRefed
<nsINode
> GetParent();
32 nsresult
EdgeChild(nsINode
** _retval
, bool aReverse
);
34 bool mShowAnonymousContent
= false;
35 bool mShowSubDocuments
= false;
36 bool mShowDocumentsAsNodes
= false;
38 // The root node. previousNode and parentNode will return
40 nsCOMPtr
<nsINode
> mRoot
;
41 nsCOMPtr
<nsINode
> mCurrentNode
;
43 // We cache the siblings of mCurrentNode as a list of nodes.
44 // Notes: normally siblings are all the children of the parent
45 // of mCurrentNode (that are interesting for use for the walk)
46 // and mCurrentIndex is the index of mCurrentNode in that list
49 // Index of mCurrentNode in the mSiblings list.
50 int32_t mCurrentIndex
= -1;
53 // {BFCB82C2-5611-4318-90D6-BAF4A7864252}
54 #define IN_DEEPTREEWALKER_CID \
56 0xbfcb82c2, 0x5611, 0x4318, { \
57 0x90, 0xd6, 0xba, 0xf4, 0xa7, 0x86, 0x42, 0x52 \
61 #endif // __inDeepTreeWalker_h___