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 nsRDFTestNode_h__ michael@0: #define nsRDFTestNode_h__ michael@0: michael@0: #include "nsRuleNetwork.h" michael@0: michael@0: class nsIRDFResource; michael@0: class nsIRDFNode; michael@0: michael@0: /** michael@0: * An abstract base class for all of the RDF-related tests. This interface michael@0: * allows us to iterate over all of the RDF tests to find the one in the michael@0: * network that is apropos for a newly-added assertion. michael@0: */ michael@0: class nsRDFTestNode : public TestNode michael@0: { michael@0: public: michael@0: nsRDFTestNode(TestNode* aParent) michael@0: : TestNode(aParent) {} michael@0: michael@0: /** michael@0: * Determine whether the node can propagate an assertion michael@0: * with the specified source, property, and target. If the michael@0: * assertion can be propagated, aInitialBindings will be michael@0: * initialized with appropriate variable-to-value assignments michael@0: * to allow the rule network to start a constrain and propagate michael@0: * search from this node in the network. michael@0: * michael@0: * @return true if the node can propagate the specified michael@0: * assertion. michael@0: */ michael@0: virtual bool CanPropagate(nsIRDFResource* aSource, michael@0: nsIRDFResource* aProperty, michael@0: nsIRDFNode* aTarget, michael@0: Instantiation& aInitialBindings) const = 0; michael@0: michael@0: /** michael@0: * michael@0: */ michael@0: virtual void Retract(nsIRDFResource* aSource, michael@0: nsIRDFResource* aProperty, michael@0: nsIRDFNode* aTarget) const = 0; michael@0: }; michael@0: michael@0: #endif // nsRDFTestNode_h__