|
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 nsXULTemplateResultSetRDF_h__ |
|
7 #define nsXULTemplateResultSetRDF_h__ |
|
8 |
|
9 #include "nsISimpleEnumerator.h" |
|
10 #include "nsRuleNetwork.h" |
|
11 #include "nsRDFQuery.h" |
|
12 #include "nsXULTemplateResultRDF.h" |
|
13 #include "mozilla/Attributes.h" |
|
14 |
|
15 class nsXULTemplateQueryProcessorRDF; |
|
16 class nsXULTemplateResultRDF; |
|
17 |
|
18 /** |
|
19 * An enumerator used to iterate over a set of results. |
|
20 */ |
|
21 class nsXULTemplateResultSetRDF MOZ_FINAL : public nsISimpleEnumerator |
|
22 { |
|
23 private: |
|
24 nsXULTemplateQueryProcessorRDF* mProcessor; |
|
25 |
|
26 nsRDFQuery* mQuery; |
|
27 |
|
28 const InstantiationSet* mInstantiations; |
|
29 |
|
30 nsCOMPtr<nsIRDFResource> mResource; |
|
31 |
|
32 InstantiationSet::List *mCurrent; |
|
33 |
|
34 bool mCheckedNext; |
|
35 |
|
36 public: |
|
37 |
|
38 // nsISupports interface |
|
39 NS_DECL_ISUPPORTS |
|
40 |
|
41 // nsISimpleEnumerator interface |
|
42 NS_DECL_NSISIMPLEENUMERATOR |
|
43 |
|
44 nsXULTemplateResultSetRDF(nsXULTemplateQueryProcessorRDF *aProcessor, |
|
45 nsRDFQuery* aQuery, |
|
46 const InstantiationSet* aInstantiations) |
|
47 : mProcessor(aProcessor), |
|
48 mQuery(aQuery), |
|
49 mInstantiations(aInstantiations), |
|
50 mCurrent(nullptr), |
|
51 mCheckedNext(false) |
|
52 { } |
|
53 |
|
54 ~nsXULTemplateResultSetRDF() |
|
55 { |
|
56 delete mInstantiations; |
|
57 } |
|
58 }; |
|
59 |
|
60 #endif // nsXULTemplateResultSetRDF_h__ |