PageRenderTime 123ms CodeModel.GetById 71ms app.highlight 3ms RepoModel.GetById 47ms 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
  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
 17class 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 */
 32class NS_NO_VTABLE NS_SCRIPTABLE nsIStreamListener : public nsIRequestObserver {
 33 public: 
 34
 35  NS_DECLARE_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
 46     *        Number of bytes that were sent in previous onDataAvailable calls
 47     *        for this request. In other words, the sum of all previous count
 48     *        parameters.
 49     *        If that number is greater than or equal to 2^32, this parameter
 50     *        will be PR_UINT32_MAX (2^32 - 1).
 51     * @param aCount number of bytes available in the stream
 52     *
 53     * NOTE: The aInputStream parameter must implement readSegments.
 54     *
 55     * An exception thrown from onDataAvailable has the side-effect of
 56     * causing the request to be canceled.
 57     */
 58  /* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount); */
 59  NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) = 0;
 60
 61};
 62
 63  NS_DEFINE_STATIC_IID_ACCESSOR(nsIStreamListener, NS_ISTREAMLISTENER_IID)
 64
 65/* Use this macro when declaring classes that implement this interface. */
 66#define NS_DECL_NSISTREAMLISTENER \
 67  NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount); 
 68
 69/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 70#define NS_FORWARD_NSISTREAMLISTENER(_to) \
 71  NS_SCRIPTABLE NS_IMETHOD OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount) { return _to OnDataAvailable(aRequest, aContext, aInputStream, aOffset, aCount); } 
 72
 73/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 74#define NS_FORWARD_SAFE_NSISTREAMLISTENER(_to) \
 75  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); } 
 76
 77#if 0
 78/* Use the code below as a template for the implementation class for this interface. */
 79
 80/* Header file */
 81class nsStreamListener : public nsIStreamListener
 82{
 83public:
 84  NS_DECL_ISUPPORTS
 85  NS_DECL_NSISTREAMLISTENER
 86
 87  nsStreamListener();
 88
 89private:
 90  ~nsStreamListener();
 91
 92protected:
 93  /* additional members */
 94};
 95
 96/* Implementation file */
 97NS_IMPL_ISUPPORTS1(nsStreamListener, nsIStreamListener)
 98
 99nsStreamListener::nsStreamListener()
100{
101  /* member initializers and constructor code */
102}
103
104nsStreamListener::~nsStreamListener()
105{
106  /* destructor code */
107}
108
109/* void onDataAvailable (in nsIRequest aRequest, in nsISupports aContext, in nsIInputStream aInputStream, in unsigned long aOffset, in unsigned long aCount); */
110NS_IMETHODIMP nsStreamListener::OnDataAvailable(nsIRequest *aRequest, nsISupports *aContext, nsIInputStream *aInputStream, PRUint32 aOffset, PRUint32 aCount)
111{
112    return NS_ERROR_NOT_IMPLEMENTED;
113}
114
115/* End of implementation class template. */
116#endif
117
118
119#endif /* __gen_nsIStreamListener_h__ */