|
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 nsXULTemplateQueryProcessorStorage_h__ |
|
7 #define nsXULTemplateQueryProcessorStorage_h__ |
|
8 |
|
9 #include "nsIXULTemplateBuilder.h" |
|
10 #include "nsIXULTemplateQueryProcessor.h" |
|
11 |
|
12 #include "nsISimpleEnumerator.h" |
|
13 #include "nsCOMArray.h" |
|
14 #include "nsIVariant.h" |
|
15 |
|
16 #include "mozIStorageValueArray.h" |
|
17 #include "mozIStorageStatement.h" |
|
18 #include "mozIStorageConnection.h" |
|
19 #include "mozilla/Attributes.h" |
|
20 |
|
21 class nsXULTemplateQueryProcessorStorage; |
|
22 |
|
23 class nsXULTemplateResultSetStorage MOZ_FINAL : public nsISimpleEnumerator |
|
24 { |
|
25 private: |
|
26 |
|
27 nsCOMPtr<mozIStorageStatement> mStatement; |
|
28 |
|
29 nsCOMArray<nsIAtom> mColumnNames; |
|
30 |
|
31 public: |
|
32 |
|
33 // nsISupports interface |
|
34 NS_DECL_ISUPPORTS |
|
35 |
|
36 // nsISimpleEnumerator interface |
|
37 NS_DECL_NSISIMPLEENUMERATOR |
|
38 |
|
39 nsXULTemplateResultSetStorage(mozIStorageStatement* aStatement); |
|
40 |
|
41 int32_t GetColumnIndex(nsIAtom* aColumnName); |
|
42 |
|
43 void FillColumnValues(nsCOMArray<nsIVariant>& aArray); |
|
44 |
|
45 }; |
|
46 |
|
47 class nsXULTemplateQueryProcessorStorage MOZ_FINAL : public nsIXULTemplateQueryProcessor |
|
48 { |
|
49 public: |
|
50 |
|
51 nsXULTemplateQueryProcessorStorage(); |
|
52 |
|
53 // nsISupports interface |
|
54 NS_DECL_ISUPPORTS |
|
55 |
|
56 // nsIXULTemplateQueryProcessor interface |
|
57 NS_DECL_NSIXULTEMPLATEQUERYPROCESSOR |
|
58 |
|
59 private: |
|
60 |
|
61 nsCOMPtr<mozIStorageConnection> mStorageConnection; |
|
62 bool mGenerationStarted; |
|
63 }; |
|
64 |
|
65 #endif // nsXULTemplateQueryProcessorStorage_h__ |