nsXULTemplateResultSetRDF.h 1.5 KB

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