content/xul/templates/src/nsContentTestNode.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/xul/templates/src/nsContentTestNode.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
     1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.8 +
     1.9 +#ifndef nsContentTestNode_h__
    1.10 +#define nsContentTestNode_h__
    1.11 +
    1.12 +#include "mozilla/Attributes.h"
    1.13 +#include "nscore.h"
    1.14 +#include "nsRuleNetwork.h"
    1.15 +#include "nsIAtom.h"
    1.16 +#include "nsIDOMDocument.h"
    1.17 +
    1.18 +class nsIXULTemplateBuilder;
    1.19 +
    1.20 +/**
    1.21 + * The nsContentTestNode is always the top node in a query's rule network. It
    1.22 + * exists so that Constrain can filter out resources that aren't part of a
    1.23 + * result.
    1.24 + */
    1.25 +class nsContentTestNode : public TestNode
    1.26 +{
    1.27 +public:
    1.28 +    nsContentTestNode(nsXULTemplateQueryProcessorRDF* aProcessor,
    1.29 +                      nsIAtom* aContentVariable);
    1.30 +
    1.31 +    virtual nsresult FilterInstantiations(InstantiationSet& aInstantiations,
    1.32 +                                          bool* aCantHandleYet) const MOZ_OVERRIDE;
    1.33 +
    1.34 +    nsresult
    1.35 +    Constrain(InstantiationSet& aInstantiations) MOZ_OVERRIDE;
    1.36 +
    1.37 +    void SetTag(nsIAtom* aTag, nsIDOMDocument* aDocument)
    1.38 +    {
    1.39 +        mTag = aTag;
    1.40 +        mDocument = aDocument;
    1.41 +    }
    1.42 +
    1.43 +protected:
    1.44 +    nsXULTemplateQueryProcessorRDF *mProcessor;
    1.45 +    nsIDOMDocument* mDocument;
    1.46 +    nsCOMPtr<nsIAtom> mRefVariable;
    1.47 +    nsCOMPtr<nsIAtom> mTag;
    1.48 +};
    1.49 +
    1.50 +#endif // nsContentTestNode_h__
    1.51 +

mercurial