PageRenderTime 520ms CodeModel.GetById 54ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIStreamListener.h

http://firefox-mac-pdf.googlecode.com/
C Header | 119 lines | 49 code | 27 blank | 43 comment | 0 complexity | 878faffa7c7cced7a88f73c801288b3a MD5 | raw file
  1. /*
  2. * DO NOT EDIT. THIS FILE IS GENERATED FROM /builds/tinderbox/XR-Trunk/Darwin_8.8.4_Depend/mozilla/netwerk/base/public/nsIStreamListener.idl
  3. */
  4. #ifndef __gen_nsIStreamListener_h__
  5. #define __gen_nsIStreamListener_h__
  6. #ifndef __gen_nsIRequestObserver_h__
  7. #include "nsIRequestObserver.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 nsIInputStream; /* forward declaration */
  14. /* starting interface: nsIStreamListener */
  15. #define NS_ISTREAMLISTENER_IID_STR "1a637020-1482-11d3-9333-00104ba0fd40"
  16. #define NS_ISTREAMLISTENER_IID \
  17. {0x1a637020, 0x1482, 0x11d3, \
  18. { 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}
  19. /**
  20. * nsIStreamListener
  21. *
  22. * @status FROZEN
  23. */
  24. class NS_NO_VTABLE NS_SCRIPTABLE nsIStreamListener : public nsIRequestObserver {
  25. public:
  26. NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTREAMLISTENER_IID)
  27. /**
  28. * Called when the next chunk of data (corresponding to the request) may
  29. * be read without blocking the calling thread. The onDataAvailable impl
  30. * must read exactly |aCount| bytes of data before returning.
  31. *
  32. * @param aRequest request corresponding to the source of the data
  33. * @param aContext user defined context
  34. * @param aInputStream input stream containing the data chunk
  35. * @param aOffset
  36. * Number of bytes that were sent in previous onDataAvailable calls
  37. * for this request. In other words, the sum of all previous count
  38. * parameters.
  39. * If that number is greater than or equal to 2^32, this parameter
  40. * will be PR_UINT32_MAX (2^32 - 1).
  41. * @param aCount number of bytes available in the stream
  42. *
  43. * NOTE: The aInputStream parameter must implement readSegments.
  44. *
  45. * An exception thrown from onDataAvailable has the side-effect of
  46. * causing the request to be canceled.
  47. */
  48. /* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount); */
  49. NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) = 0;
  50. };
  51. NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamListener, NS_ISTREAMLISTENER_IID)
  52. /* Use this macro when declaring classes that implement this interface. */
  53. #define NS_DECL_NSISTREAMLISTENER \
  54. NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount);
  55. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  56. #define NS_FORWARD_NSISTREAMLISTENER(_to) \
  57. NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) { return _to OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); }
  58. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  59. #define NS_FORWARD_SAFE_NSISTREAMLISTENER(_to) \
  60. NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); }
  61. #if 0
  62. /* Use the code below as a template for the implementation class for this interface. */
  63. /* Header file */
  64. class nsStreamListener : public nsIStreamListener
  65. {
  66. public:
  67. NS_DECL_ISUPPORTS
  68. NS_DECL_NSISTREAMLISTENER
  69. nsStreamListener();
  70. private:
  71. ~nsStreamListener();
  72. protected:
  73. /* additional members */
  74. };
  75. /* Implementation file */
  76. NS_IMPL_ISUPPORTS1(nsStreamListener, nsIStreamListener)
  77. nsStreamListener::nsStreamListener()
  78. {
  79. /* member initializers and constructor code */
  80. }
  81. nsStreamListener::~nsStreamListener()
  82. {
  83. /* destructor code */
  84. }
  85. /* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount); */
  86. NS_IMETHODIMP nsStreamListener::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount)
  87. {
  88. return NS_ERROR_NOT_IMPLEMENTED;
  89. }
  90. /* End of implementation class template. */
  91. #endif
  92. #endif /* __gen_nsIStreamListener_h__ */