Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 :
6 : #ifndef nsContentTestNode_h__
7 : #define nsContentTestNode_h__
8 :
9 : #include "mozilla/Attributes.h"
10 : #include "nscore.h"
11 : #include "nsRuleNetwork.h"
12 : #include "nsIAtom.h"
13 : #include "nsIDOMDocument.h"
14 :
15 : class nsXULTemplateQueryProcessorRDF;
16 :
17 : /**
18 : * The nsContentTestNode is always the top node in a query's rule network. It
19 : * exists so that Constrain can filter out resources that aren't part of a
20 : * result.
21 : */
22 0 : class nsContentTestNode : public TestNode
23 : {
24 : public:
25 : nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
26 : nsIAtom* aContentVariable);
27 :
28 : virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations,
29 : bool* aCantHandleYet) const override;
30 :
31 : nsresult
32 : Constrain(InstantiationSet& aInstantiations) override;
33 :
34 0 : void SetTag(nsIAtom* aTag, nsIDOMDocument* aDocument)
35 : {
36 0 : mTag = aTag;
37 0 : mDocument = aDocument;
38 0 : }
39 :
40 : protected:
41 : nsXULTemplateQueryProcessorRDF *mProcessor;
42 : nsIDOMDocument* mDocument;
43 : nsCOMPtr<nsIAtom> mRefVariable;
44 : nsCOMPtr<nsIAtom> mTag;
45 : };
46 :
47 : #endif // nsContentTestNode_h__
48 :
|