/*
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIStreamProvider.idl
 */

#ifndef __gen_nsIStreamProvider_h__
#define __gen_nsIStreamProvider_h__


#ifndef __gen_nsIRequestObserver_h__
#include "nsIRequestObserver.h"
#endif

/* For IDL files that don't want to include root IDL files. */
#ifndef NS_NO_VTABLE
#define NS_NO_VTABLE
#endif
class nsIOutputStream; /* forward declaration */


/* starting interface:    nsIStreamProvider */
#define NS_ISTREAMPROVIDER_IID_STR "d10ef7a9-b728-43d4-9c49-74172186d691"

#define NS_ISTREAMPROVIDER_IID \
  {0xd10ef7a9, 0xb728, 0x43d4, \
    { 0x9c, 0x49, 0x74, 0x17, 0x21, 0x86, 0xd6, 0x91 }}

/**
 * nsIStreamProvider
 */
class NS_NO_VTABLE nsIStreamProvider : public nsIRequestObserver {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMPROVIDER_IID)

  /**
     * Called when data may be written to the channel.
     *
     * @param aRequest request returned by AsyncWrite
     * @param aContext opaque parameter passed to AsyncWrite
     * @param aOutputStream output stream for writing data chunk
     * @param aOffset current stream position (informational)
     * @param aCount number of bytes that can be written without blocking
     *
     * An exception thrown from onDataWritable has the side-effect of
     * causing the request to be canceled.
     */
  /* void onDataWritable (in nsIRequest aRequest, in nsISupports aContext, in nsIOutputStream aOutputStream, in unsigned long aOffset, in unsigned long aCount); */
  NS_IMETHOD OnDataWritable(nsIRequest *aRequest, nsISupports *aContext, nsIOutputStream *aOutputStream, PRUint32 aOffset, PRUint32 aCount) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMPROVIDER \
  NS_IMETHOD OnDataWritable(nsIRequest *aRequest, nsISupports *aContext, nsIOutputStream *aOutputStream, PRUint32 aOffset, PRUint32 aCount); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMPROVIDER(_to) \
  NS_IMETHOD OnDataWritable(nsIRequest *aRequest, nsISupports *aContext, nsIOutputStream *aOutputStream, PRUint32 aOffset, PRUint32 aCount) { return _to OnDataWritable(aRequest, aContext, aOutputStream, aOffset, aCount); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISTREAMPROVIDER(_to) \
  NS_IMETHOD OnDataWritable(nsIRequest *aRequest, nsISupports *aContext, nsIOutputStream *aOutputStream, PRUint32 aOffset, PRUint32 aCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnDataWritable(aRequest, aContext, aOutputStream, aOffset, aCount); } 

#if 0
/* Use the code below as a template for the implementation class for this interface. */

/* Header file */
class nsStreamProvider : public nsIStreamProvider
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTREAMPROVIDER

  nsStreamProvider();
  virtual ~nsStreamProvider();
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsStreamProvider, nsIStreamProvider)

nsStreamProvider::nsStreamProvider()
{
  NS_INIT_ISUPPORTS();
  /* member initializers and constructor code */
}

nsStreamProvider::~nsStreamProvider()
{
  /* destructor code */
}

/* void onDataWritable (in nsIRequest aRequest, in nsISupports aContext, in nsIOutputStream aOutputStream, in unsigned long aOffset, in unsigned long aCount); */
NS_IMETHODIMP nsStreamProvider::OnDataWritable(nsIRequest *aRequest, nsISupports *aContext, nsIOutputStream *aOutputStream, PRUint32 aOffset, PRUint32 aCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* End of implementation class template. */
#endif


#endif /* __gen_nsIStreamProvider_h__ */
