2008-07-22 00:38:52 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
|
|
*
|
2012-05-21 11:12:37 +00: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/. */
|
2008-07-22 00:38:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Implementation of DOM Traversal's nsIDOMTreeWalker
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef nsTraversal_h___
|
|
|
|
#define nsTraversal_h___
|
|
|
|
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
|
|
|
|
class nsINode;
|
|
|
|
class nsIDOMNodeFilter;
|
|
|
|
|
|
|
|
class nsTraversal
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
nsTraversal(nsINode *aRoot,
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t aWhatToShow,
|
2013-02-26 20:34:25 +00:00
|
|
|
nsIDOMNodeFilter *aFilter);
|
2008-07-22 00:38:52 +00:00
|
|
|
virtual ~nsTraversal();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
nsCOMPtr<nsINode> mRoot;
|
2012-08-22 15:56:38 +00:00
|
|
|
uint32_t mWhatToShow;
|
2013-02-26 20:34:25 +00:00
|
|
|
nsCOMPtr<nsIDOMNodeFilter> mFilter;
|
2011-09-29 06:19:26 +00:00
|
|
|
bool mInAcceptNode;
|
2008-07-22 00:38:52 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Tests if and how a node should be filtered. Uses mWhatToShow and
|
|
|
|
* mFilter to test the node.
|
|
|
|
* @param aNode Node to test
|
|
|
|
* @param _filtered Returned filtervalue. See nsIDOMNodeFilter.idl
|
|
|
|
* @returns Errorcode
|
|
|
|
*/
|
2012-08-22 15:56:38 +00:00
|
|
|
nsresult TestNode(nsINode* aNode, int16_t* _filtered);
|
2008-07-22 00:38:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|