nsXULTemplateQueryProcessorStorage.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  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. #ifndef nsXULTemplateQueryProcessorStorage_h__
  6. #define nsXULTemplateQueryProcessorStorage_h__
  7. #include "nsIXULTemplateBuilder.h"
  8. #include "nsIXULTemplateQueryProcessor.h"
  9. #include "nsISimpleEnumerator.h"
  10. #include "nsCOMArray.h"
  11. #include "nsIVariant.h"
  12. #include "mozIStorageValueArray.h"
  13. #include "mozIStorageStatement.h"
  14. #include "mozIStorageConnection.h"
  15. #include "mozilla/Attributes.h"
  16. class nsXULTemplateQueryProcessorStorage;
  17. class nsXULTemplateResultSetStorage final : public nsISimpleEnumerator
  18. {
  19. private:
  20. nsCOMPtr<mozIStorageStatement> mStatement;
  21. nsCOMArray<nsIAtom> mColumnNames;
  22. ~nsXULTemplateResultSetStorage() {}
  23. public:
  24. // nsISupports interface
  25. NS_DECL_ISUPPORTS
  26. // nsISimpleEnumerator interface
  27. NS_DECL_NSISIMPLEENUMERATOR
  28. explicit nsXULTemplateResultSetStorage(mozIStorageStatement* aStatement);
  29. int32_t GetColumnIndex(nsIAtom* aColumnName);
  30. void FillColumnValues(nsCOMArray<nsIVariant>& aArray);
  31. };
  32. class nsXULTemplateQueryProcessorStorage final : public nsIXULTemplateQueryProcessor
  33. {
  34. public:
  35. nsXULTemplateQueryProcessorStorage();
  36. // nsISupports interface
  37. NS_DECL_ISUPPORTS
  38. // nsIXULTemplateQueryProcessor interface
  39. NS_DECL_NSIXULTEMPLATEQUERYPROCESSOR
  40. private:
  41. ~nsXULTemplateQueryProcessorStorage() {}
  42. nsCOMPtr<mozIStorageConnection> mStorageConnection;
  43. bool mGenerationStarted;
  44. };
  45. #endif // nsXULTemplateQueryProcessorStorage_h__