2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#ifndef __inDeepTreeWalker_h___
|
|
|
|
#define __inDeepTreeWalker_h___
|
|
|
|
|
|
|
|
#include "inIDeepTreeWalker.h"
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIDOMNode.h"
|
2009-02-03 06:42:18 -08:00
|
|
|
#include "nsTArray.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class inIDOMUtils;
|
2009-03-12 00:26:29 -07:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
struct DeepTreeStackItem
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMNode> node;
|
|
|
|
nsCOMPtr<nsIDOMNodeList> kids;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t lastIndex; // Index one bigger than the index of whatever
|
2009-10-20 10:27:46 -07:00
|
|
|
// kid we're currently at in |kids|.
|
2009-03-12 00:26:29 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
////////////////////////////////////////////////////
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
class inDeepTreeWalker : public inIDeepTreeWalker
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_INIDEEPTREEWALKER
|
|
|
|
|
|
|
|
inDeepTreeWalker();
|
|
|
|
virtual ~inDeepTreeWalker();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void PushNode(nsIDOMNode* aNode);
|
|
|
|
|
2011-09-28 23:19:26 -07:00
|
|
|
bool mShowAnonymousContent;
|
|
|
|
bool mShowSubDocuments;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<nsIDOMNode> mRoot;
|
|
|
|
nsCOMPtr<nsIDOMNode> mCurrentNode;
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t mWhatToShow;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2009-03-12 00:26:29 -07:00
|
|
|
nsAutoTArray<DeepTreeStackItem, 8> mStack;
|
2007-03-22 10:30:00 -07:00
|
|
|
nsCOMPtr<inIDOMUtils> mDOMUtils;
|
|
|
|
};
|
|
|
|
|
|
|
|
// {BFCB82C2-5611-4318-90D6-BAF4A7864252}
|
|
|
|
#define IN_DEEPTREEWALKER_CID \
|
|
|
|
{ 0xbfcb82c2, 0x5611, 0x4318, { 0x90, 0xd6, 0xba, 0xf4, 0xa7, 0x86, 0x42, 0x52 } }
|
|
|
|
|
|
|
|
#endif // __inDeepTreeWalker_h___
|