michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: * Implementation of DOM Traversal's nsIDOMTreeWalker michael@0: */ michael@0: michael@0: #ifndef nsTraversal_h___ michael@0: #define nsTraversal_h___ michael@0: michael@0: #include "nsCOMPtr.h" michael@0: #include "nsIDocument.h" michael@0: #include "mozilla/dom/CallbackObject.h" michael@0: #include "mozilla/ErrorResult.h" michael@0: #include "mozilla/dom/NodeFilterBinding.h" michael@0: #include "nsIDOMNodeFilter.h" michael@0: michael@0: class nsINode; michael@0: michael@0: class nsTraversal michael@0: { michael@0: public: michael@0: nsTraversal(nsINode *aRoot, michael@0: uint32_t aWhatToShow, michael@0: const mozilla::dom::NodeFilterHolder &aFilter); michael@0: virtual ~nsTraversal(); michael@0: michael@0: protected: michael@0: nsCOMPtr mRoot; michael@0: uint32_t mWhatToShow; michael@0: mozilla::dom::NodeFilterHolder mFilter; michael@0: bool mInAcceptNode; michael@0: michael@0: /* michael@0: * Tests if and how a node should be filtered. Uses mWhatToShow and michael@0: * mFilter to test the node. michael@0: * @param aNode Node to test michael@0: * @param aResult Whether we succeeded michael@0: * @returns Filtervalue. See nsIDOMNodeFilter.idl michael@0: */ michael@0: int16_t TestNode(nsINode* aNode, mozilla::ErrorResult& aResult); michael@0: }; michael@0: michael@0: #endif michael@0: