PageRenderTime 50ms CodeModel.GetById 12ms RepoModel.GetById 0ms app.codeStats 0ms

/gecko_api/include/nsIWebBrowserStream.h

http://firefox-mac-pdf.googlecode.com/
C Header | 156 lines | 65 code | 31 blank | 60 comment | 0 complexity | 361efed24f98628e023b7dad918bda4d MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/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 NS_SCRIPTABLE nsIWebBrowserStream : public nsISupports {
  27. public:
  28. NS_DECLARE_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_SCRIPTABLE 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_SCRIPTABLE 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_SCRIPTABLE NS_IMETHOD CloseStream(void) = 0;
  67. };
  68. NS_DEFINE_STATIC_IID_ACCESSOR(nsIWebBrowserStream, NS_IWEBBROWSERSTREAM_IID)
  69. /* Use this macro when declaring classes that implement this interface. */
  70. #define NS_DECL_NSIWEBBROWSERSTREAM \
  71. NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType); \
  72. NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen); \
  73. NS_SCRIPTABLE NS_IMETHOD CloseStream(void);
  74. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  75. #define NS_FORWARD_NSIWEBBROWSERSTREAM(_to) \
  76. NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) { return _to OpenStream(aBaseURI, aContentType); } \
  77. NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) { return _to AppendToStream(aData, aLen); } \
  78. NS_SCRIPTABLE NS_IMETHOD CloseStream(void) { return _to CloseStream(); }
  79. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  80. #define NS_FORWARD_SAFE_NSIWEBBROWSERSTREAM(_to) \
  81. NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenStream(aBaseURI, aContentType); } \
  82. NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendToStream(aData, aLen); } \
  83. NS_SCRIPTABLE NS_IMETHOD CloseStream(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloseStream(); }
  84. #if 0
  85. /* Use the code below as a template for the implementation class for this interface. */
  86. /* Header file */
  87. class nsWebBrowserStream : public nsIWebBrowserStream
  88. {
  89. public:
  90. NS_DECL_ISUPPORTS
  91. NS_DECL_NSIWEBBROWSERSTREAM
  92. nsWebBrowserStream();
  93. private:
  94. ~nsWebBrowserStream();
  95. protected:
  96. /* additional members */
  97. };
  98. /* Implementation file */
  99. NS_IMPL_ISUPPORTS1(nsWebBrowserStream, nsIWebBrowserStream)
  100. nsWebBrowserStream::nsWebBrowserStream()
  101. {
  102. /* member initializers and constructor code */
  103. }
  104. nsWebBrowserStream::~nsWebBrowserStream()
  105. {
  106. /* destructor code */
  107. }
  108. /* void openStream (in nsIURI aBaseURI, in ACString aContentType); */
  109. NS_IMETHODIMP nsWebBrowserStream::OpenStream(nsIURI *aBaseURI, const nsACString & aContentType)
  110. {
  111. return NS_ERROR_NOT_IMPLEMENTED;
  112. }
  113. /* void appendToStream ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
  114. NS_IMETHODIMP nsWebBrowserStream::AppendToStream(const PRUint8 *aData, PRUint32 aLen)
  115. {
  116. return NS_ERROR_NOT_IMPLEMENTED;
  117. }
  118. /* void closeStream (); */
  119. NS_IMETHODIMP nsWebBrowserStream::CloseStream()
  120. {
  121. return NS_ERROR_NOT_IMPLEMENTED;
  122. }
  123. /* End of implementation class template. */
  124. #endif
  125. #endif /* __gen_nsIWebBrowserStream_h__ */