PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 4ms RepoModel.GetById 36ms 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
  5#ifndef __gen_nsIWebBrowserStream_h__
  6#define __gen_nsIWebBrowserStream_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 nsIURI; /* forward declaration */
 18
 19
 20/* starting interface:    nsIWebBrowserStream */
 21#define NS_IWEBBROWSERSTREAM_IID_STR "86d02f0e-219b-4cfc-9c88-bd98d2cce0b8"
 22
 23#define NS_IWEBBROWSERSTREAM_IID \
 24  {0x86d02f0e, 0x219b, 0x4cfc, \
 25    { 0x9c, 0x88, 0xbd, 0x98, 0xd2, 0xcc, 0xe0, 0xb8 }}
 26
 27/**
 28 * This interface provides a way to stream data to the web browser. This allows
 29 * loading of data from sources which can not be accessed using URIs and
 30 * nsIWebNavigation.
 31 *
 32 * @status FROZEN
 33 */
 34class NS_NO_VTABLE NS_SCRIPTABLE nsIWebBrowserStream : public nsISupports {
 35 public: 
 36
 37  NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWEBBROWSERSTREAM_IID)
 38
 39  /**
 40   * Prepare to load a stream of data. When this function returns successfully,
 41   * it must be paired by a call to closeStream.
 42   *
 43   * @param aBaseURI
 44   *        The base URI of the data. Must not be null. Relative
 45   *        URIs will be resolved relative to this URI.
 46   * @param aContentType
 47   *        ASCII string giving the content type of the data. If rendering
 48   *        content of this type is not supported, this method fails.
 49   *        This string may include a charset declaration, for example:
 50   *        text/html;charset=ISO-8859-1
 51   *
 52   * @throw NS_ERROR_NOT_AVAILABLE
 53   *        The requested content type is not supported.
 54   * @throw NS_ERROR_IN_PROGRESS
 55   *        openStream was called twice without an intermediate closeStream.
 56   */
 57  /* void openStream (in nsIURI aBaseURI, in ACString aContentType); */
 58  NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) = 0;
 59
 60  /**
 61   * Append data to this stream.
 62   * @param aData The data to append
 63   * @param aLen  Length of the data to append.
 64   *
 65   * @note To append more than 4 GB of data, call this method multiple times.
 66   */
 67  /* void appendToStream ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
 68  NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) = 0;
 69
 70  /**
 71   * Notifies the browser that all the data has been appended. This may notify
 72   * the user that the browser is "done loading" in some form.
 73   *
 74   * @throw NS_ERROR_UNEXPECTED
 75   *        This method was called without a preceding openStream.
 76   */
 77  /* void closeStream (); */
 78  NS_SCRIPTABLE NS_IMETHOD CloseStream(void) = 0;
 79
 80};
 81
 82  NS_DEFINE_STATIC_IID_ACCESSOR(nsIWebBrowserStream, NS_IWEBBROWSERSTREAM_IID)
 83
 84/* Use this macro when declaring classes that implement this interface. */
 85#define NS_DECL_NSIWEBBROWSERSTREAM \
 86  NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType); \
 87  NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen); \
 88  NS_SCRIPTABLE NS_IMETHOD CloseStream(void); 
 89
 90/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 91#define NS_FORWARD_NSIWEBBROWSERSTREAM(_to) \
 92  NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) { return _to OpenStream(aBaseURI, aContentType); } \
 93  NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) { return _to AppendToStream(aData, aLen); } \
 94  NS_SCRIPTABLE NS_IMETHOD CloseStream(void) { return _to CloseStream(); } 
 95
 96/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 97#define NS_FORWARD_SAFE_NSIWEBBROWSERSTREAM(_to) \
 98  NS_SCRIPTABLE NS_IMETHOD OpenStream(nsIURI *aBaseURI, const nsACString & aContentType) { return !_to ? NS_ERROR_NULL_POINTER : _to->OpenStream(aBaseURI, aContentType); } \
 99  NS_SCRIPTABLE NS_IMETHOD AppendToStream(const PRUint8 *aData, PRUint32 aLen) { return !_to ? NS_ERROR_NULL_POINTER : _to->AppendToStream(aData, aLen); } \
100  NS_SCRIPTABLE NS_IMETHOD CloseStream(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->CloseStream(); } 
101
102#if 0
103/* Use the code below as a template for the implementation class for this interface. */
104
105/* Header file */
106class nsWebBrowserStream : public nsIWebBrowserStream
107{
108public:
109  NS_DECL_ISUPPORTS
110  NS_DECL_NSIWEBBROWSERSTREAM
111
112  nsWebBrowserStream();
113
114private:
115  ~nsWebBrowserStream();
116
117protected:
118  /* additional members */
119};
120
121/* Implementation file */
122NS_IMPL_ISUPPORTS1(nsWebBrowserStream, nsIWebBrowserStream)
123
124nsWebBrowserStream::nsWebBrowserStream()
125{
126  /* member initializers and constructor code */
127}
128
129nsWebBrowserStream::~nsWebBrowserStream()
130{
131  /* destructor code */
132}
133
134/* void openStream (in nsIURI aBaseURI, in ACString aContentType); */
135NS_IMETHODIMP nsWebBrowserStream::OpenStream(nsIURI *aBaseURI, const nsACString & aContentType)
136{
137    return NS_ERROR_NOT_IMPLEMENTED;
138}
139
140/* void appendToStream ([array, size_is (aLen), const] in octet aData, in unsigned long aLen); */
141NS_IMETHODIMP nsWebBrowserStream::AppendToStream(const PRUint8 *aData, PRUint32 aLen)
142{
143    return NS_ERROR_NOT_IMPLEMENTED;
144}
145
146/* void closeStream (); */
147NS_IMETHODIMP nsWebBrowserStream::CloseStream()
148{
149    return NS_ERROR_NOT_IMPLEMENTED;
150}
151
152/* End of implementation class template. */
153#endif
154
155
156#endif /* __gen_nsIWebBrowserStream_h__ */