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/nsIUploadChannel.idl |
| 3 */ |
| 4 |
| 5 #ifndef __gen_nsIUploadChannel_h__ |
| 6 #define __gen_nsIUploadChannel_h__ |
| 7 |
| 8 |
| 9 #ifndef __gen_nsISupports_h__ |
| 10 #include "nsISupports.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: nsIUploadChannel */ |
| 21 #define NS_IUPLOADCHANNEL_IID_STR "ddf633d8-e9a4-439d-ad88-de636fd9bb75" |
| 22 |
| 23 #define NS_IUPLOADCHANNEL_IID \ |
| 24 {0xddf633d8, 0xe9a4, 0x439d, \ |
| 25 { 0xad, 0x88, 0xde, 0x63, 0x6f, 0xd9, 0xbb, 0x75 }} |
| 26 |
| 27 /** |
| 28 * nsIUploadChannel |
| 29 * |
| 30 * A channel may optionally implement this interface if it supports the |
| 31 * notion of uploading a data stream. The upload stream may only be set |
| 32 * prior to the invocation of asyncOpen on the channel. |
| 33 * |
| 34 * @status FROZEN |
| 35 */ |
| 36 class NS_NO_VTABLE nsIUploadChannel : public nsISupports { |
| 37 public: |
| 38 |
| 39 NS_DEFINE_STATIC_IID_ACCESSOR(NS_IUPLOADCHANNEL_IID) |
| 40 |
| 41 /** |
| 42 * Sets a stream to be uploaded by this channel. |
| 43 * |
| 44 * Most implementations of this interface require that the stream: |
| 45 * (1) implement threadsafe addRef and release |
| 46 * (2) implement nsIInputStream::readSegments |
| 47 * (3) implement nsISeekableStream::seek |
| 48 * |
| 49 * History here is that we need to support both streams that already have |
| 50 * headers (e.g., Content-Type and Content-Length) information prepended to |
| 51 * the stream (by plugins) as well as clients (composer, uploading |
| 52 * application) that want to upload data streams without any knowledge of |
| 53 * protocol specifications. For this reason, we have a special meaning |
| 54 * for the aContentType parameter (see below). |
| 55 * |
| 56 * @param aStream |
| 57 * The stream to be uploaded by this channel. |
| 58 * @param aContentType |
| 59 * If aContentType is empty, the protocol will assume that no |
| 60 * content headers are to be added to the uploaded stream and that |
| 61 * any required headers are already encoded in the stream. In the |
| 62 * case of HTTP, if this parameter is non-empty, then its value will |
| 63 * replace any existing Content-Type header on the HTTP request. |
| 64 * In the case of FTP and FILE, this parameter is ignored. |
| 65 * @param aContentLength |
| 66 * A value of -1 indicates that the length of the stream should be |
| 67 * determined by calling the stream's |available| method. |
| 68 */ |
| 69 /* void setUploadStream (in nsIInputStream aStream, in ACString aContentType,
in long aContentLength); */ |
| 70 NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aConten
tType, PRInt32 aContentLength) = 0; |
| 71 |
| 72 /** |
| 73 * Get the stream (to be) uploaded by this channel. |
| 74 */ |
| 75 /* readonly attribute nsIInputStream uploadStream; */ |
| 76 NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream) = 0; |
| 77 |
| 78 }; |
| 79 |
| 80 /* Use this macro when declaring classes that implement this interface. */ |
| 81 #define NS_DECL_NSIUPLOADCHANNEL \ |
| 82 NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aConten
tType, PRInt32 aContentLength); \ |
| 83 NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream); |
| 84 |
| 85 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object. */ |
| 86 #define NS_FORWARD_NSIUPLOADCHANNEL(_to) \ |
| 87 NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aConten
tType, PRInt32 aContentLength) { return _to SetUploadStream(aStream, aContentTyp
e, aContentLength); } \ |
| 88 NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream) { return _to GetUp
loadStream(aUploadStream); } |
| 89 |
| 90 /* Use this macro to declare functions that forward the behavior of this interfa
ce to another object in a safe way. */ |
| 91 #define NS_FORWARD_SAFE_NSIUPLOADCHANNEL(_to) \ |
| 92 NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aConten
tType, PRInt32 aContentLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetU
ploadStream(aStream, aContentType, aContentLength); } \ |
| 93 NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream) { return !_to ? NS
_ERROR_NULL_POINTER : _to->GetUploadStream(aUploadStream); } |
| 94 |
| 95 #if 0 |
| 96 /* Use the code below as a template for the implementation class for this interf
ace. */ |
| 97 |
| 98 /* Header file */ |
| 99 class nsUploadChannel : public nsIUploadChannel |
| 100 { |
| 101 public: |
| 102 NS_DECL_ISUPPORTS |
| 103 NS_DECL_NSIUPLOADCHANNEL |
| 104 |
| 105 nsUploadChannel(); |
| 106 |
| 107 private: |
| 108 ~nsUploadChannel(); |
| 109 |
| 110 protected: |
| 111 /* additional members */ |
| 112 }; |
| 113 |
| 114 /* Implementation file */ |
| 115 NS_IMPL_ISUPPORTS1(nsUploadChannel, nsIUploadChannel) |
| 116 |
| 117 nsUploadChannel::nsUploadChannel() |
| 118 { |
| 119 /* member initializers and constructor code */ |
| 120 } |
| 121 |
| 122 nsUploadChannel::~nsUploadChannel() |
| 123 { |
| 124 /* destructor code */ |
| 125 } |
| 126 |
| 127 /* void setUploadStream (in nsIInputStream aStream, in ACString aContentType, in
long aContentLength); */ |
| 128 NS_IMETHODIMP nsUploadChannel::SetUploadStream(nsIInputStream *aStream, const ns
ACString & aContentType, PRInt32 aContentLength) |
| 129 { |
| 130 return NS_ERROR_NOT_IMPLEMENTED; |
| 131 } |
| 132 |
| 133 /* readonly attribute nsIInputStream uploadStream; */ |
| 134 NS_IMETHODIMP nsUploadChannel::GetUploadStream(nsIInputStream * *aUploadStream) |
| 135 { |
| 136 return NS_ERROR_NOT_IMPLEMENTED; |
| 137 } |
| 138 |
| 139 /* End of implementation class template. */ |
| 140 #endif |
| 141 |
| 142 |
| 143 #endif /* __gen_nsIUploadChannel_h__ */ |
OLD | NEW |