content/xul/templates/src/nsXULTemplateResultRDF.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 #ifndef nsXULTemplateResultRDF_h__
michael@0 7 #define nsXULTemplateResultRDF_h__
michael@0 8
michael@0 9 #include "nsCOMPtr.h"
michael@0 10 #include "nsIRDFResource.h"
michael@0 11 #include "nsXULTemplateQueryProcessorRDF.h"
michael@0 12 #include "nsRDFQuery.h"
michael@0 13 #include "nsRuleNetwork.h"
michael@0 14 #include "nsIXULTemplateResult.h"
michael@0 15 #include "nsRDFBinding.h"
michael@0 16 #include "mozilla/Attributes.h"
michael@0 17
michael@0 18 /**
michael@0 19 * A single result of a query on an RDF graph
michael@0 20 */
michael@0 21 class nsXULTemplateResultRDF MOZ_FINAL : public nsIXULTemplateResult
michael@0 22 {
michael@0 23 public:
michael@0 24 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
michael@0 25 NS_DECL_CYCLE_COLLECTION_CLASS(nsXULTemplateResultRDF)
michael@0 26
michael@0 27 NS_DECL_NSIXULTEMPLATERESULT
michael@0 28
michael@0 29 nsXULTemplateResultRDF(nsIRDFResource* aNode);
michael@0 30
michael@0 31 nsXULTemplateResultRDF(nsRDFQuery* aQuery,
michael@0 32 const Instantiation& aInst,
michael@0 33 nsIRDFResource* aNode);
michael@0 34
michael@0 35 ~nsXULTemplateResultRDF();
michael@0 36
michael@0 37 nsITemplateRDFQuery* Query() { return mQuery; }
michael@0 38
michael@0 39 nsXULTemplateQueryProcessorRDF* GetProcessor()
michael@0 40 {
michael@0 41 return (mQuery ? mQuery->Processor() : nullptr);
michael@0 42 }
michael@0 43
michael@0 44 /**
michael@0 45 * Get the value of a variable, first by looking in the assignments and
michael@0 46 * then the bindings
michael@0 47 */
michael@0 48 void
michael@0 49 GetAssignment(nsIAtom* aVar, nsIRDFNode** aValue);
michael@0 50
michael@0 51 /**
michael@0 52 * Synchronize the bindings after a change in the RDF graph. Bindings that
michael@0 53 * would be affected will be assigned appropriately based on the change.
michael@0 54 */
michael@0 55 bool
michael@0 56 SyncAssignments(nsIRDFResource* aSubject,
michael@0 57 nsIRDFResource* aPredicate,
michael@0 58 nsIRDFNode* aTarget);
michael@0 59
michael@0 60 /**
michael@0 61 * Return true if the result has an instantiation involving a particular
michael@0 62 * memory element.
michael@0 63 */
michael@0 64 bool
michael@0 65 HasMemoryElement(const MemoryElement& aMemoryElement);
michael@0 66
michael@0 67 protected:
michael@0 68
michael@0 69 // query that generated the result
michael@0 70 nsCOMPtr<nsITemplateRDFQuery> mQuery;
michael@0 71
michael@0 72 // resource node
michael@0 73 nsCOMPtr<nsIRDFResource> mNode;
michael@0 74
michael@0 75 // data computed from query
michael@0 76 Instantiation mInst;
michael@0 77
michael@0 78 // extra assignments made by rules (<binding> tags)
michael@0 79 nsBindingValues mBindingValues;
michael@0 80 };
michael@0 81
michael@0 82 #endif // nsXULTemplateResultRDF_h__

mercurial