nsXULTemplateResultXML.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 nsXULTemplateResultXML_h__
  6. #define nsXULTemplateResultXML_h__
  7. #include "nsCOMPtr.h"
  8. #include "nsIContent.h"
  9. #include "nsIURI.h"
  10. #include "nsIRDFResource.h"
  11. #include "nsXULTemplateQueryProcessorXML.h"
  12. #include "nsIXULTemplateResult.h"
  13. #include "mozilla/Attributes.h"
  14. /**
  15. * An single result of an query
  16. */
  17. class nsXULTemplateResultXML final : public nsIXULTemplateResult
  18. {
  19. public:
  20. NS_DECL_ISUPPORTS
  21. NS_DECL_NSIXULTEMPLATERESULT
  22. nsXULTemplateResultXML(nsXMLQuery* aQuery,
  23. nsIContent* aNode,
  24. nsXMLBindingSet* aBindings);
  25. nsIContent* Node()
  26. {
  27. return mNode;
  28. }
  29. protected:
  30. ~nsXULTemplateResultXML() {}
  31. // ID used for persisting data. It is constructed using the mNode's
  32. // base uri plus the node's id to form 'baseuri#id'. If the node has no
  33. // id, then an id of the form 'row<some number>' is generated. In the
  34. // latter case, persistence will not work as there won't be a unique id.
  35. nsAutoString mId;
  36. // query that generated the result
  37. nsCOMPtr<nsXMLQuery> mQuery;
  38. // context node in datasource
  39. nsCOMPtr<nsIContent> mNode;
  40. // assignments in query
  41. nsXMLBindingValues mRequiredValues;
  42. // extra assignments made by rules (<binding> tags)
  43. nsXMLBindingValues mOptionalValues;
  44. };
  45. #endif // nsXULTemplateResultXML_h__