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

#ifndef __gen_nsIObservableInputStream_h__
#define __gen_nsIObservableInputStream_h__


#ifndef __gen_nsISupports_h__
#include "nsISupports.h"
#endif

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

class nsIInputStreamObserver; /* forward declaration */


/* starting interface:    nsIObservableInputStream */
#define NS_IOBSERVABLEINPUTSTREAM_IID_STR "6f489efe-1dd2-11b2-af78-fb84ae21591b"

#define NS_IOBSERVABLEINPUTSTREAM_IID \
  {0x6f489efe, 0x1dd2, 0x11b2, \
    { 0xaf, 0x78, 0xfb, 0x84, 0xae, 0x21, 0x59, 0x1b }}

class NS_NO_VTABLE nsIObservableInputStream : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IOBSERVABLEINPUTSTREAM_IID)

  /**
     * Allows users to set an observer on an input stream to receive notifications
     * about the consumer emptying the input stream's underlying buffer, or closing the
     * stream. This is necessary for non-blocking streams so that the producer can suspend
     * itself until more data can be written.
     */
  /* attribute nsIInputStreamObserver observer; */
  NS_IMETHOD GetObserver(nsIInputStreamObserver * *aObserver) = 0;
  NS_IMETHOD SetObserver(nsIInputStreamObserver * aObserver) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOBSERVABLEINPUTSTREAM \
  NS_IMETHOD GetObserver(nsIInputStreamObserver * *aObserver); \
  NS_IMETHOD SetObserver(nsIInputStreamObserver * aObserver); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOBSERVABLEINPUTSTREAM(_to) \
  NS_IMETHOD GetObserver(nsIInputStreamObserver * *aObserver) { return _to GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIInputStreamObserver * aObserver) { return _to SetObserver(aObserver); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIOBSERVABLEINPUTSTREAM(_to) \
  NS_IMETHOD GetObserver(nsIInputStreamObserver * *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIInputStreamObserver * aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetObserver(aObserver); } 

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

/* Header file */
class nsObservableInputStream : public nsIObservableInputStream
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVABLEINPUTSTREAM

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsObservableInputStream, nsIObservableInputStream)

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

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

/* attribute nsIInputStreamObserver observer; */
NS_IMETHODIMP nsObservableInputStream::GetObserver(nsIInputStreamObserver * *aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}
NS_IMETHODIMP nsObservableInputStream::SetObserver(nsIInputStreamObserver * aObserver)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


/* starting interface:    nsIInputStreamObserver */
#define NS_IINPUTSTREAMOBSERVER_IID_STR "019d67cc-61b4-11d4-9877-00c04fa0cf4a"

#define NS_IINPUTSTREAMOBSERVER_IID \
  {0x019d67cc, 0x61b4, 0x11d4, \
    { 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}

class NS_NO_VTABLE nsIInputStreamObserver : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IINPUTSTREAMOBSERVER_IID)

  /**
     * Called when the input stream's consumer has read all the existing data from the stream.
     */
  /* void onEmpty (in nsIInputStream inStr); */
  NS_IMETHOD OnEmpty(nsIInputStream *inStr) = 0;

  /**
     * Called when the consumer closes its end of the stream.
     */
  /* void onClose (in nsIInputStream inStr); */
  NS_IMETHOD OnClose(nsIInputStream *inStr) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIINPUTSTREAMOBSERVER \
  NS_IMETHOD OnEmpty(nsIInputStream *inStr); \
  NS_IMETHOD OnClose(nsIInputStream *inStr); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIINPUTSTREAMOBSERVER(_to) \
  NS_IMETHOD OnEmpty(nsIInputStream *inStr) { return _to OnEmpty(inStr); } \
  NS_IMETHOD OnClose(nsIInputStream *inStr) { return _to OnClose(inStr); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIINPUTSTREAMOBSERVER(_to) \
  NS_IMETHOD OnEmpty(nsIInputStream *inStr) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnEmpty(inStr); } \
  NS_IMETHOD OnClose(nsIInputStream *inStr) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnClose(inStr); } 

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

/* Header file */
class nsInputStreamObserver : public nsIInputStreamObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIINPUTSTREAMOBSERVER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsInputStreamObserver, nsIInputStreamObserver)

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

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

/* void onEmpty (in nsIInputStream inStr); */
NS_IMETHODIMP nsInputStreamObserver::OnEmpty(nsIInputStream *inStr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onClose (in nsIInputStream inStr); */
NS_IMETHODIMP nsInputStreamObserver::OnClose(nsIInputStream *inStr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIObservableInputStream_h__ */
