nsIWebBrowserStream.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/mozilla/embedding/browser/webBrowser/nsIWebBrowserStream.idl
  3. */
  4. #ifndef __gen_nsIWebBrowserStream_h__
  5. #define __gen_nsIWebBrowserStream_h__
  6. #ifndef __gen_nsISupports_h__
  7. #include "nsISupports.h"
  8. #endif
  9. /* For IDL files that don't want to include root IDL files. */
  10. #ifndef NS_NO_VTABLE
  11. #define NS_NO_VTABLE
  12. #endif
  13. class nsIURI; /* forward declaration */
  14. /* starting interface: nsIWebBrowserStream */
  15. #define NS_IWEBBROWSERSTREAM_IID_STR "86d02f0e-219b-4cfc-9c88-bd98d2cce0b8"
  16. #define NS_IWEBBROWSERSTREAM_IID \
  17. {0x86d02f0e, 0x219b, 0x4cfc, \
  18. { 0x9c, 0x88, 0xbd, 0x98, 0xd2, 0xcc, 0xe0, 0xb8 }}
  19. /**
  20. * This interface provides a way to stream data to the web browser. This allows
  21. * loading of data from sources which can not be accessed using URIs and
  22. * nsIWebNavigation.
  23. *
  24. * @status FROZEN
  25. */
  26. class NS_NO_VTABLE nsIWebBrowserStream : public nsISupports {
  27. public:
  28. NS_DEFINE_STATIC_IID_ACCESSOR(NS_IWEBBROWSERSTREAM_IID)
  29. /**
  30. * Prepare to load a stream of data. When this function returns successfully,
  31. * it must be paired by a call to closeStream.
  32. *
  33. * @param aBaseURI
  34. * The base URI of the data. Must not be null. Relative
  35. * URIs will be resolved relative to this URI.
  36. * @param aContentType
  37. * ASCII string giving the content type of the data. If rendering
  38. * content of this type is not supported, this method fails.
  39. * This string may include a charset declaration, for example:
  40. * text/html;charset=ISO-8859-1
  41. *
  42. * @throw NS_ERROR_NOT_AVAILABLE
  43. * The requested content type is not supported.
  44. * @throw NS_ERROR_IN_PROGRESS
  45. * openStream was called twice without an intermediate closeStream.
  46. */
  47. /* void openStream (in nsIURI aBaseURI, in ACString aContentType); */
  48. NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) = 0;
  49. /**
  50. * Append data to this stream.
  51. * @param aData The data to append
  52. * @param aLen Length of the data to append.
  53. *
  54. * @note To append more than 4 GB of data, call this method multiple times.
  55. */
  56. /* void appendToStream ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
  57. NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) = 0;
  58. /**
  59. * Notifies the browser that all the data has been appended. This may notify
  60. * the user that the browser is "done loading" in some form.
  61. *
  62. * @throw NS_ERROR_UNEXPECTED
  63. * This method was called without a preceding openStream.
  64. */
  65. /* void closeStream (); */
  66. NS_IMETHOD CloseStream(void) = 0;
  67. };
  68. /* Use this macro when declaring classes that implement this interface. */
  69. #define NS_DECL_NSIWEBBROWSERSTREAM \
  70. NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType); \
  71. NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen); \
  72. NS_IMETHOD CloseStream(void);
  73. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  74. #define NS_FORWARD_NSIWEBBROWSERSTREAM(_to) \
  75. NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) { return _to OpenStream(aBaseURI, aContentType); } \
  76. NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) { return _to AppendToStream(aData, aLen); } \
  77. NS_IMETHOD CloseStream(void) { return _to CloseStream(); }
  78. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  79. #define NS_FORWARD_SAFE_NSIWEBBROWSERSTREAM(_to) \
  80. NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenStream(aBaseURI, aContentType); } \
  81. NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendToStream(aData, aLen); } \
  82. NS_IMETHOD CloseStream(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloseStream(); }
  83. #if 0
  84. /* Use the code below as a template for the implementation class for this interface. */
  85. /* Header file */
  86. class nsWebBrowserStream : public nsIWebBrowserStream
  87. {
  88. public:
  89. NS_DECL_ISUPPORTS
  90. NS_DECL_NSIWEBBROWSERSTREAM
  91. nsWebBrowserStream();
  92. private:
  93. ~nsWebBrowserStream();
  94. protected:
  95. /* additional members */
  96. };
  97. /* Implementation file */
  98. NS_IMPL_ISUPPORTS1(nsWebBrowserStream, nsIWebBrowserStream)
  99. nsWebBrowserStream::nsWebBrowserStream()
  100. {
  101. /* member initializers and constructor code */
  102. }
  103. nsWebBrowserStream::~nsWebBrowserStream()
  104. {
  105. /* destructor code */
  106. }
  107. /* void openStream (in nsIURI aBaseURI, in ACString aContentType); */
  108. NS_IMETHODIMP nsWebBrowserStream::OpenStream(nsIURI *aBaseURI, const nsACString & aContentType)
  109. {
  110. return NS_ERROR_NOT_IMPLEMENTED;
  111. }
  112. /* void appendToStream ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
  113. NS_IMETHODIMP nsWebBrowserStream::AppendToStream(const PRUint8 *aData, PRUint32 aLen)
  114. {
  115. return NS_ERROR_NOT_IMPLEMENTED;
  116. }
  117. /* void closeStream (); */
  118. NS_IMETHODIMP nsWebBrowserStream::CloseStream()
  119. {
  120. return NS_ERROR_NOT_IMPLEMENTED;
  121. }
  122. /* End of implementation class template. */
  123. #endif
  124. #endif /* __gen_nsIWebBrowserStream_h__ */