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

#ifndef __gen_nsIStreamListener_h__
#define __gen_nsIStreamListener_h__

#include "nsIStreamObserver.h"

class nsIInputStream; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIOutputStream; /* forward declaration */

class nsIEventQueue; /* forward declaration */


/* starting interface:    nsIStreamListener */
#define NS_ISTREAMLISTENER_IID_STR "1a637020-1482-11d3-9333-00104ba0fd40"

#define NS_ISTREAMLISTENER_IID \
  {0x1a637020, 0x1482, 0x11d3, \
    { 0x93, 0x33, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}

class NS_NO_VTABLE nsIStreamListener : public nsIStreamObserver {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISTREAMLISTENER_IID)

  /* void onDataAvailable (in nsIChannel channel, in nsISupports ctxt, in nsIInputStream inStr, in unsigned long sourceOffset, in unsigned long count); */
  NS_IMETHOD OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISTREAMLISTENER \
  NS_IMETHOD OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISTREAMLISTENER(_to) \
  NS_IMETHOD OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count) { return _to ## OnDataAvailable(channel, ctxt, inStr, sourceOffset, count); } 

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

/* Header file */
class nsStreamListener : public nsIStreamListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISTREAMLISTENER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsStreamListener, nsIStreamListener)

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

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

/* void onDataAvailable (in nsIChannel channel, in nsISupports ctxt, in nsIInputStream inStr, in unsigned long sourceOffset, in unsigned long count); */
NS_IMETHODIMP nsStreamListener::OnDataAvailable(nsIChannel *channel, nsISupports *ctxt, nsIInputStream *inStr, PRUint32 sourceOffset, PRUint32 count)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsIAsyncStreamListener */
#define NS_IASYNCSTREAMLISTENER_IID_STR "1b012ade-91bf-11d3-8cd9-0060b0fc14a3"

#define NS_IASYNCSTREAMLISTENER_IID \
  {0x1b012ade, 0x91bf, 0x11d3, \
    { 0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}

/**
 * An asynchronous stream listener is used to ship data over to another thread specified
 * by the thread's event queue. The receiver stream listener is then used to receive
 * the notifications on the other thread. 
 *
 * This interface only provides the initialization needed after construction. Otherwise,
 * these objects are used simply as nsIStreamListener.
 */
class NS_NO_VTABLE nsIAsyncStreamListener : public nsIStreamListener {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IASYNCSTREAMLISTENER_IID)

  /**
     * Initializes an nsIAsyncStreamListener. 
     * @param eventQueue - may be null indicating the calling thread's event queue
     */
  /* void init (in nsIStreamListener receiver, in nsIEventQueue eventQueue); */
  NS_IMETHOD Init(nsIStreamListener *receiver, nsIEventQueue *eventQueue) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIASYNCSTREAMLISTENER \
  NS_IMETHOD Init(nsIStreamListener *receiver, nsIEventQueue *eventQueue); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIASYNCSTREAMLISTENER(_to) \
  NS_IMETHOD Init(nsIStreamListener *receiver, nsIEventQueue *eventQueue) { return _to ## Init(receiver, eventQueue); } 

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

/* Header file */
class nsAsyncStreamListener : public nsIAsyncStreamListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIASYNCSTREAMLISTENER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsAsyncStreamListener, nsIAsyncStreamListener)

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

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

/* void init (in nsIStreamListener receiver, in nsIEventQueue eventQueue); */
NS_IMETHODIMP nsAsyncStreamListener::Init(nsIStreamListener *receiver, nsIEventQueue *eventQueue)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsISyncStreamListener */
#define NS_ISYNCSTREAMLISTENER_IID_STR "1f9fb93e-91bf-11d3-8cd9-0060b0fc14a3"

#define NS_ISYNCSTREAMLISTENER_IID \
  {0x1f9fb93e, 0x91bf, 0x11d3, \
    { 0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3 }}

/**
 * A synchronous stream listener pushes data through a pipe that ends up
 * in an input stream to be read by another thread.
 *
 * This interface only provides the initialization needed after construction. Otherwise,
 * these objects are used simply as nsIStreamListener.
 */
class NS_NO_VTABLE nsISyncStreamListener : public nsIStreamListener {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISYNCSTREAMLISTENER_IID)

  /**
     * Initializes an nsISyncStreamListener. 
     */
  /* void init (out nsIInputStream inStream, out nsIOutputStream outStream); */
  NS_IMETHOD Init(nsIInputStream **inStream, nsIOutputStream **outStream) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISYNCSTREAMLISTENER \
  NS_IMETHOD Init(nsIInputStream **inStream, nsIOutputStream **outStream); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISYNCSTREAMLISTENER(_to) \
  NS_IMETHOD Init(nsIInputStream **inStream, nsIOutputStream **outStream) { return _to ## Init(inStream, outStream); } 

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

/* Header file */
class nsSyncStreamListener : public nsISyncStreamListener
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISYNCSTREAMLISTENER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsSyncStreamListener, nsISyncStreamListener)

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

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

/* void init (out nsIInputStream inStream, out nsIOutputStream outStream); */
NS_IMETHODIMP nsSyncStreamListener::Init(nsIInputStream **inStream, nsIOutputStream **outStream)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

// Use this CID to construct an nsIAsyncStreamListener
#define NS_ASYNCSTREAMLISTENER_CID                   \
{ /* 60047bb2-91c0-11d3-8cd9-0060b0fc14a3 */         \
    0x60047bb2,                                      \
    0x91c0,                                          \
    0x11d3,                                          \
    {0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
}
// Use this CID to construct an nsISyncStreamListener
#define NS_SYNCSTREAMLISTENER_CID                    \
{ /* 65fa5cb2-91c0-11d3-8cd9-0060b0fc14a3 */         \
    0x65fa5cb2,                                      \
    0x91c0,                                          \
    0x11d3,                                          \
    {0x8c, 0xd9, 0x00, 0x60, 0xb0, 0xfc, 0x14, 0xa3} \
}

#endif /* __gen_nsIStreamListener_h__ */
