|
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef nsXULTemplateResultXML_h__ |
|
7 #define nsXULTemplateResultXML_h__ |
|
8 |
|
9 #include "nsCOMPtr.h" |
|
10 #include "nsIURI.h" |
|
11 #include "nsIRDFResource.h" |
|
12 #include "nsXULTemplateQueryProcessorXML.h" |
|
13 #include "nsIXULTemplateResult.h" |
|
14 #include "mozilla/Attributes.h" |
|
15 |
|
16 /** |
|
17 * An single result of an query |
|
18 */ |
|
19 class nsXULTemplateResultXML MOZ_FINAL : public nsIXULTemplateResult |
|
20 { |
|
21 public: |
|
22 NS_DECL_ISUPPORTS |
|
23 |
|
24 NS_DECL_NSIXULTEMPLATERESULT |
|
25 |
|
26 nsXULTemplateResultXML(nsXMLQuery* aQuery, |
|
27 nsIDOMNode* aNode, |
|
28 nsXMLBindingSet* aBindings); |
|
29 |
|
30 ~nsXULTemplateResultXML() {} |
|
31 |
|
32 void GetNode(nsIDOMNode** aNode); |
|
33 |
|
34 protected: |
|
35 |
|
36 // ID used for persisting data. It is constructed using the mNode's |
|
37 // base uri plus the node's id to form 'baseuri#id'. If the node has no |
|
38 // id, then an id of the form 'row<some number>' is generated. In the |
|
39 // latter case, persistence will not work as there won't be a unique id. |
|
40 nsAutoString mId; |
|
41 |
|
42 // query that generated the result |
|
43 nsCOMPtr<nsXMLQuery> mQuery; |
|
44 |
|
45 // context node in datasource |
|
46 nsCOMPtr<nsIDOMNode> mNode; |
|
47 |
|
48 // assignments in query |
|
49 nsXMLBindingValues mRequiredValues; |
|
50 |
|
51 // extra assignments made by rules (<binding> tags) |
|
52 nsXMLBindingValues mOptionalValues; |
|
53 }; |
|
54 |
|
55 #endif // nsXULTemplateResultXML_h__ |