1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/layout/inspector/inDeepTreeWalker.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef __inDeepTreeWalker_h___ 1.9 +#define __inDeepTreeWalker_h___ 1.10 + 1.11 +#include "inIDeepTreeWalker.h" 1.12 + 1.13 +#include "nsCOMPtr.h" 1.14 +#include "nsIDOMNode.h" 1.15 +#include "nsTArray.h" 1.16 + 1.17 +class inIDOMUtils; 1.18 + 1.19 +//////////////////////////////////////////////////// 1.20 + 1.21 +struct DeepTreeStackItem 1.22 +{ 1.23 + nsCOMPtr<nsIDOMNode> node; 1.24 + nsCOMPtr<nsIDOMNodeList> kids; 1.25 + uint32_t lastIndex; // Index one bigger than the index of whatever 1.26 + // kid we're currently at in |kids|. 1.27 +}; 1.28 + 1.29 +//////////////////////////////////////////////////// 1.30 + 1.31 +class inDeepTreeWalker : public inIDeepTreeWalker 1.32 +{ 1.33 +public: 1.34 + NS_DECL_ISUPPORTS 1.35 + NS_DECL_NSIDOMTREEWALKER 1.36 + NS_DECL_INIDEEPTREEWALKER 1.37 + 1.38 + inDeepTreeWalker(); 1.39 + virtual ~inDeepTreeWalker(); 1.40 + 1.41 +protected: 1.42 + void PushNode(nsIDOMNode* aNode); 1.43 + 1.44 + bool mShowAnonymousContent; 1.45 + bool mShowSubDocuments; 1.46 + nsCOMPtr<nsIDOMNode> mRoot; 1.47 + nsCOMPtr<nsIDOMNode> mCurrentNode; 1.48 + uint32_t mWhatToShow; 1.49 + 1.50 + nsAutoTArray<DeepTreeStackItem, 8> mStack; 1.51 + nsCOMPtr<inIDOMUtils> mDOMUtils; 1.52 +}; 1.53 + 1.54 +// {BFCB82C2-5611-4318-90D6-BAF4A7864252} 1.55 +#define IN_DEEPTREEWALKER_CID \ 1.56 +{ 0xbfcb82c2, 0x5611, 0x4318, { 0x90, 0xd6, 0xba, 0xf4, 0xa7, 0x86, 0x42, 0x52 } } 1.57 + 1.58 +#endif // __inDeepTreeWalker_h___