1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/xul/templates/src/nsRDFTestNode.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,49 @@ 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 nsRDFTestNode_h__ 1.10 +#define nsRDFTestNode_h__ 1.11 + 1.12 +#include "nsRuleNetwork.h" 1.13 + 1.14 +class nsIRDFResource; 1.15 +class nsIRDFNode; 1.16 + 1.17 +/** 1.18 + * An abstract base class for all of the RDF-related tests. This interface 1.19 + * allows us to iterate over all of the RDF tests to find the one in the 1.20 + * network that is apropos for a newly-added assertion. 1.21 + */ 1.22 +class nsRDFTestNode : public TestNode 1.23 +{ 1.24 +public: 1.25 + nsRDFTestNode(TestNode* aParent) 1.26 + : TestNode(aParent) {} 1.27 + 1.28 + /** 1.29 + * Determine whether the node can propagate an assertion 1.30 + * with the specified source, property, and target. If the 1.31 + * assertion can be propagated, aInitialBindings will be 1.32 + * initialized with appropriate variable-to-value assignments 1.33 + * to allow the rule network to start a constrain and propagate 1.34 + * search from this node in the network. 1.35 + * 1.36 + * @return true if the node can propagate the specified 1.37 + * assertion. 1.38 + */ 1.39 + virtual bool CanPropagate(nsIRDFResource* aSource, 1.40 + nsIRDFResource* aProperty, 1.41 + nsIRDFNode* aTarget, 1.42 + Instantiation& aInitialBindings) const = 0; 1.43 + 1.44 + /** 1.45 + * 1.46 + */ 1.47 + virtual void Retract(nsIRDFResource* aSource, 1.48 + nsIRDFResource* aProperty, 1.49 + nsIRDFNode* aTarget) const = 0; 1.50 +}; 1.51 + 1.52 +#endif // nsRDFTestNode_h__