1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/content/xul/templates/src/nsXULTemplateResultXML.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,55 @@ 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 nsXULTemplateResultXML_h__ 1.10 +#define nsXULTemplateResultXML_h__ 1.11 + 1.12 +#include "nsCOMPtr.h" 1.13 +#include "nsIURI.h" 1.14 +#include "nsIRDFResource.h" 1.15 +#include "nsXULTemplateQueryProcessorXML.h" 1.16 +#include "nsIXULTemplateResult.h" 1.17 +#include "mozilla/Attributes.h" 1.18 + 1.19 +/** 1.20 + * An single result of an query 1.21 + */ 1.22 +class nsXULTemplateResultXML MOZ_FINAL : public nsIXULTemplateResult 1.23 +{ 1.24 +public: 1.25 + NS_DECL_ISUPPORTS 1.26 + 1.27 + NS_DECL_NSIXULTEMPLATERESULT 1.28 + 1.29 + nsXULTemplateResultXML(nsXMLQuery* aQuery, 1.30 + nsIDOMNode* aNode, 1.31 + nsXMLBindingSet* aBindings); 1.32 + 1.33 + ~nsXULTemplateResultXML() {} 1.34 + 1.35 + void GetNode(nsIDOMNode** aNode); 1.36 + 1.37 +protected: 1.38 + 1.39 + // ID used for persisting data. It is constructed using the mNode's 1.40 + // base uri plus the node's id to form 'baseuri#id'. If the node has no 1.41 + // id, then an id of the form 'row<some number>' is generated. In the 1.42 + // latter case, persistence will not work as there won't be a unique id. 1.43 + nsAutoString mId; 1.44 + 1.45 + // query that generated the result 1.46 + nsCOMPtr<nsXMLQuery> mQuery; 1.47 + 1.48 + // context node in datasource 1.49 + nsCOMPtr<nsIDOMNode> mNode; 1.50 + 1.51 + // assignments in query 1.52 + nsXMLBindingValues mRequiredValues; 1.53 + 1.54 + // extra assignments made by rules (<binding> tags) 1.55 + nsXMLBindingValues mOptionalValues; 1.56 +}; 1.57 + 1.58 +#endif // nsXULTemplateResultXML_h__