nsIDocumentTransformer.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. /* This Source Code Form is subject to the terms of the Mozilla Public
  2. * License, v. 2.0. If a copy of the MPL was not distributed with this
  3. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  4. #ifndef nsIDocumentTransformer_h__
  5. #define nsIDocumentTransformer_h__
  6. #include "nsISupports.h"
  7. template<class> class nsCOMPtr;
  8. class nsIContent;
  9. class nsIDocument;
  10. class nsIDOMNode;
  11. class nsIURI;
  12. class nsString;
  13. template<class> class nsTArray;
  14. #define NS_ITRANSFORMOBSERVER_IID \
  15. { 0x04b2d17c, 0xe98d, 0x45f5, \
  16. { 0x9a, 0x67, 0xb7, 0x01, 0x19, 0x59, 0x7d, 0xe7 } }
  17. class nsITransformObserver : public nsISupports
  18. {
  19. public:
  20. NS_DECLARE_STATIC_IID_ACCESSOR(NS_ITRANSFORMOBSERVER_IID)
  21. NS_IMETHOD OnDocumentCreated(nsIDocument *aResultDocument) = 0;
  22. NS_IMETHOD OnTransformDone(nsresult aResult,
  23. nsIDocument *aResultDocument) = 0;
  24. };
  25. NS_DEFINE_STATIC_IID_ACCESSOR(nsITransformObserver, NS_ITRANSFORMOBSERVER_IID)
  26. #define NS_IDOCUMENTTRANSFORMER_IID \
  27. { 0xf45e1ff8, 0x50f3, 0x4496, \
  28. { 0xb3, 0xa2, 0x0e, 0x03, 0xe8, 0x4a, 0x57, 0x11 } }
  29. class nsIDocumentTransformer : public nsISupports
  30. {
  31. public:
  32. NS_DECLARE_STATIC_IID_ACCESSOR(NS_IDOCUMENTTRANSFORMER_IID)
  33. NS_IMETHOD SetTransformObserver(nsITransformObserver* aObserver) = 0;
  34. NS_IMETHOD LoadStyleSheet(nsIURI* aUri, nsIDocument* aLoaderDocument) = 0;
  35. NS_IMETHOD SetSourceContentModel(nsIDocument* aDocument,
  36. const nsTArray<nsCOMPtr<nsIContent>>& aSource) = 0;
  37. NS_IMETHOD CancelLoads() = 0;
  38. NS_IMETHOD AddXSLTParamNamespace(const nsString& aPrefix,
  39. const nsString& aNamespace) = 0;
  40. NS_IMETHOD AddXSLTParam(const nsString& aName,
  41. const nsString& aNamespace,
  42. const nsString& aValue,
  43. const nsString& aSelect,
  44. nsIDOMNode* aContextNode) = 0;
  45. };
  46. NS_DEFINE_STATIC_IID_ACCESSOR(nsIDocumentTransformer,
  47. NS_IDOCUMENTTRANSFORMER_IID)
  48. #endif //nsIDocumentTransformer_h__