PageRenderTime 51ms CodeModel.GetById 42ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/gecko_api/include/nsIUploadChannel.h

http://firefox-mac-pdf.googlecode.com/
C++ Header | 145 lines | 57 code | 29 blank | 59 comment | 0 complexity | 915b2106242eb9bfb7e01fdba831b2ba 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/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
 17class 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 */
 36class NS_NO_VTABLE NS_SCRIPTABLE nsIUploadChannel : public nsISupports {
 37 public: 
 38
 39  NS_DECLARE_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_SCRIPTABLE NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aContentType, PRInt32 aContentLength) = 0;
 71
 72  /**
 73     * Get the stream (to be) uploaded by this channel.
 74     */
 75  /* readonly attribute nsIInputStream uploadStream; */
 76  NS_SCRIPTABLE NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream) = 0;
 77
 78};
 79
 80  NS_DEFINE_STATIC_IID_ACCESSOR(nsIUploadChannel, NS_IUPLOADCHANNEL_IID)
 81
 82/* Use this macro when declaring classes that implement this interface. */
 83#define NS_DECL_NSIUPLOADCHANNEL \
 84  NS_SCRIPTABLE NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aContentType, PRInt32 aContentLength); \
 85  NS_SCRIPTABLE NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream); 
 86
 87/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 88#define NS_FORWARD_NSIUPLOADCHANNEL(_to) \
 89  NS_SCRIPTABLE NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aContentType, PRInt32 aContentLength) { return _to SetUploadStream(aStream, aContentType, aContentLength); } \
 90  NS_SCRIPTABLE NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream) { return _to GetUploadStream(aUploadStream); } 
 91
 92/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 93#define NS_FORWARD_SAFE_NSIUPLOADCHANNEL(_to) \
 94  NS_SCRIPTABLE NS_IMETHOD SetUploadStream(nsIInputStream *aStream, const nsACString & aContentType, PRInt32 aContentLength) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetUploadStream(aStream, aContentType, aContentLength); } \
 95  NS_SCRIPTABLE NS_IMETHOD GetUploadStream(nsIInputStream * *aUploadStream) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetUploadStream(aUploadStream); } 
 96
 97#if 0
 98/* Use the code below as a template for the implementation class for this interface. */
 99
100/* Header file */
101class nsUploadChannel : public nsIUploadChannel
102{
103public:
104  NS_DECL_ISUPPORTS
105  NS_DECL_NSIUPLOADCHANNEL
106
107  nsUploadChannel();
108
109private:
110  ~nsUploadChannel();
111
112protected:
113  /* additional members */
114};
115
116/* Implementation file */
117NS_IMPL_ISUPPORTS1(nsUploadChannel, nsIUploadChannel)
118
119nsUploadChannel::nsUploadChannel()
120{
121  /* member initializers and constructor code */
122}
123
124nsUploadChannel::~nsUploadChannel()
125{
126  /* destructor code */
127}
128
129/* void setUploadStream (in nsIInputStream aStream, in ACString aContentType, in long aContentLength); */
130NS_IMETHODIMP nsUploadChannel::SetUploadStream(nsIInputStream *aStream, const nsACString & aContentType, PRInt32 aContentLength)
131{
132    return NS_ERROR_NOT_IMPLEMENTED;
133}
134
135/* readonly attribute nsIInputStream uploadStream; */
136NS_IMETHODIMP nsUploadChannel::GetUploadStream(nsIInputStream * *aUploadStream)
137{
138    return NS_ERROR_NOT_IMPLEMENTED;
139}
140
141/* End of implementation class template. */
142#endif
143
144
145#endif /* __gen_nsIUploadChannel_h__ */