OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * DO NOT EDIT. THIS FILE IS GENERATED FROM c:/builds/tinderbox/XR-Mozilla1.8.0
-Release/WINNT_5.2_Depend/mozilla/netwerk/base/public/nsIStreamListener.idl |
| 3 */ |
| 4 |
| 5 #ifndef __gen_nsIStreamListener_h__ |
| 6 #define __gen_nsIStreamListener_h__ |
| 7 |
| 8 |
| 9 #ifndef __gen_nsIRequestObserver_h__ |
| 10 #include "nsIRequestObserver.h" |
| 11 #endif |
| 12 |
| 13 /* For IDL files that don't want to include root IDL files. */ |
| 14 #ifndef NS_NO_VTABLE |
| 15 #define NS_NO_VTABLE |
| 16 #endif |
| 17 class nsIInputStream; /* forward declaration */ |
| 18 |
| 19 |
| 20 /* starting interface: nsIStreamListener */ |
| 21 #define NS_ISTREAMLISTENER_IID_STR "1a637020-1482-11d3-9333-00104ba0fd40" |
| 22 |
| 23 #define NS_ISTREAMLISTENER_IID \ |
| 24 {0x1a637020, 0x1482, 0x11d3, \ |
| 25 { 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }} |
| 26 |
| 27 /** |
| 28 * nsIStreamListener |
| 29 * |
| 30 * @status FROZEN |
| 31 */ |
| 32 class NS_NO_VTABLE nsIStreamListener : public nsIRequestObserver { |
| 33 public: |
| 34 |
| 35 NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMLISTENER_IID) |
| 36 |
| 37 /** |
| 38 * Called when the next chunk of data (corresponding to the request) may |
| 39 * be read without blocking the calling thread. The onDataAvailable impl |
| 40 * must read exactly |aCount| bytes of data before returning. |
| 41 * |
| 42 * @param aRequest request corresponding to the source of the data |
| 43 * @param aContext user defined context |
| 44 * @param aInputStream input stream containing the data chunk |
| 45 * @param aOffset current stream position |
| 46 * @param aCount number of bytes available in the stream |
| 47 * |
| 48 * NOTE: The aInputStream parameter must implement readSegments. |
| 49 * |
| 50 * An exception thrown from onDataAvailable has the side-effect of |
| 51 * causing the request to be canceled. |
| 52 */ |
| 53 /* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in n
sIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount);
*/ |
| 54 NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInp
utStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) = 0; |
| 55 |
| 56 }; |
| 57 |
| 58 /* Use this macro when declaring classes that implement this interface. */ |
| 59 #define NS_DECL_NSISTREAMLISTENER \ |
| 60 NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInp
utStream *aInputStream, PRUint32 aOffset, PRUint32 aCount); |
| 61 |
| 62 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 63 #define NS_FORWARD_NSISTREAMLISTENER(_to) \ |
| 64 NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInp
utStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) { return _to OnDataAv
ailable(aRequest, aContext, aInputStream, aOffset, aCount); } |
| 65 |
| 66 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 67 #define NS_FORWARD_SAFE_NSISTREAMLISTENER(_to) \ |
| 68 NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInp
utStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) { return !_to ? NS_ER
ROR_NULL_POINTER : _to->OnDataAvailable(aRequest, aContext, aInputStream, aOffse
t, aCount); } |
| 69 |
| 70 #if 0 |
| 71 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 72 |
| 73 /* Header file */ |
| 74 class nsStreamListener : public nsIStreamListener |
| 75 { |
| 76 public: |
| 77 NS_DECL_ISUPPORTS |
| 78 NS_DECL_NSISTREAMLISTENER |
| 79 |
| 80 nsStreamListener(); |
| 81 |
| 82 private: |
| 83 ~nsStreamListener(); |
| 84 |
| 85 protected: |
| 86 /* additional members */ |
| 87 }; |
| 88 |
| 89 /* Implementation file */ |
| 90 NS_IMPL_ISUPPORTS1(nsStreamListener, nsIStreamListener) |
| 91 |
| 92 nsStreamListener::nsStreamListener() |
| 93 { |
| 94 /* member initializers and constructor code */ |
| 95 } |
| 96 |
| 97 nsStreamListener::~nsStreamListener() |
| 98 { |
| 99 /* destructor code */ |
| 100 } |
| 101 |
| 102 /* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsI
InputStream aInputStream, in unsigned long aOffset, in unsigned long aCount); */ |
| 103 NS_IMETHODIMP nsStreamListener::OnDataAvailable(nsIRequest *aRequest, nsISupport
s *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) |
| 104 { |
| 105 return NS_ERROR_NOT_IMPLEMENTED; |
| 106 } |
| 107 |
| 108 /* End of implementation class template. */ |
| 109 #endif |
| 110 |
| 111 |
| 112 #endif /* __gen_nsIStreamListener_h__ */ |
OLD | NEW |