michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ 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: #ifndef nsContentTestNode_h__ michael@0: #define nsContentTestNode_h__ michael@0: michael@0: #include "mozilla/Attributes.h" michael@0: #include "nscore.h" michael@0: #include "nsRuleNetwork.h" michael@0: #include "nsIAtom.h" michael@0: #include "nsIDOMDocument.h" michael@0: michael@0: class nsIXULTemplateBuilder; michael@0: michael@0: /** michael@0: * The nsContentTestNode is always the top node in a query's rule network. It michael@0: * exists so that Constrain can filter out resources that aren't part of a michael@0: * result. michael@0: */ michael@0: class nsContentTestNode : public TestNode michael@0: { michael@0: public: michael@0: nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor, michael@0: nsIAtom* aContentVariable); michael@0: michael@0: virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations, michael@0: bool* aCantHandleYet) const MOZ_OVERRIDE; michael@0: michael@0: nsresult michael@0: Constrain(InstantiationSet& aInstantiations) MOZ_OVERRIDE; michael@0: michael@0: void SetTag(nsIAtom* aTag, nsIDOMDocument* aDocument) michael@0: { michael@0: mTag = aTag; michael@0: mDocument = aDocument; michael@0: } michael@0: michael@0: protected: michael@0: nsXULTemplateQueryProcessorRDF *mProcessor; michael@0: nsIDOMDocument* mDocument; michael@0: nsCOMPtr mRefVariable; michael@0: nsCOMPtr mTag; michael@0: }; michael@0: michael@0: #endif // nsContentTestNode_h__ michael@0: