content/xul/templates/src/nsContentTestNode.h

branch
TOR_BUG_3246
changeset 7
129ffea94266
equal deleted inserted replaced
-1:000000000000 0:53b938150e45
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 nsIXULTemplateBuilder;
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 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 MOZ_OVERRIDE;
30
31 nsresult
32 Constrain(InstantiationSet& aInstantiations) MOZ_OVERRIDE;
33
34 void SetTag(nsIAtom* aTag, nsIDOMDocument* aDocument)
35 {
36 mTag = aTag;
37 mDocument = aDocument;
38 }
39
40 protected:
41 nsXULTemplateQueryProcessorRDF *mProcessor;
42 nsIDOMDocument* mDocument;
43 nsCOMPtr<nsIAtom> mRefVariable;
44 nsCOMPtr<nsIAtom> mTag;
45 };
46
47 #endif // nsContentTestNode_h__
48

mercurial