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

#ifndef __gen_nsIObservableOutputStream_h__
#define __gen_nsIObservableOutputStream_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 nsIOutputStream; /* forward declaration */

class nsIOutputStreamObserver; /* forward declaration */


/* starting interface:    nsIObservableOutputStream */
#define NS_IOBSERVABLEOUTPUTSTREAM_IID_STR "15b374f8-1dd2-11b2-87ab-c3299d704fd3"

#define NS_IOBSERVABLEOUTPUTSTREAM_IID \
  {0x15b374f8, 0x1dd2, 0x11b2, \
    { 0x87, 0xab, 0xc3, 0x29, 0x9d, 0x70, 0x4f, 0xd3 }}

class NS_NO_VTABLE nsIObservableOutputStream : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IOBSERVABLEOUTPUTSTREAM_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 nsIOutputStreamObserver observer; */
  NS_IMETHOD GetObserver(nsIOutputStreamObserver * *aObserver) = 0;
  NS_IMETHOD SetObserver(nsIOutputStreamObserver * aObserver) = 0;

};

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

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOBSERVABLEOUTPUTSTREAM(_to) \
  NS_IMETHOD GetObserver(nsIOutputStreamObserver * *aObserver) { return _to GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIOutputStreamObserver * 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_NSIOBSERVABLEOUTPUTSTREAM(_to) \
  NS_IMETHOD GetObserver(nsIOutputStreamObserver * *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetObserver(aObserver); } \
  NS_IMETHOD SetObserver(nsIOutputStreamObserver * 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 nsObservableOutputStream : public nsIObservableOutputStream
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOBSERVABLEOUTPUTSTREAM

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsObservableOutputStream, nsIObservableOutputStream)

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

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

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

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


/* starting interface:    nsIOutputStreamObserver */
#define NS_IOUTPUTSTREAMOBSERVER_IID_STR "12314194-61b4-11d4-9877-00c04fa0cf4a"

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

class NS_NO_VTABLE nsIOutputStreamObserver : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IOUTPUTSTREAMOBSERVER_IID)

  /**
     * Called when the output stream's producer has written more data into the stream.
     */
  /* void onWrite (in nsIOutputStream outStr, in unsigned long amount); */
  NS_IMETHOD OnWrite(nsIOutputStream *outStr, PRUint32 amount) = 0;

  /**
     * Called when the stream's underlying buffer becomes full.
     */
  /* void onFull (in nsIOutputStream outStr); */
  NS_IMETHOD OnFull(nsIOutputStream *outStr) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIOUTPUTSTREAMOBSERVER \
  NS_IMETHOD OnWrite(nsIOutputStream *outStr, PRUint32 amount); \
  NS_IMETHOD OnFull(nsIOutputStream *outStr); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIOUTPUTSTREAMOBSERVER(_to) \
  NS_IMETHOD OnWrite(nsIOutputStream *outStr, PRUint32 amount) { return _to OnWrite(outStr, amount); } \
  NS_IMETHOD OnFull(nsIOutputStream *outStr) { return _to OnFull(outStr); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIOUTPUTSTREAMOBSERVER(_to) \
  NS_IMETHOD OnWrite(nsIOutputStream *outStr, PRUint32 amount) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnWrite(outStr, amount); } \
  NS_IMETHOD OnFull(nsIOutputStream *outStr) { return !_to ? NS_ERROR_NULL_POINTER : _to->OnFull(outStr); } 

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

/* Header file */
class nsOutputStreamObserver : public nsIOutputStreamObserver
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIOUTPUTSTREAMOBSERVER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsOutputStreamObserver, nsIOutputStreamObserver)

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

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

/* void onWrite (in nsIOutputStream outStr, in unsigned long amount); */
NS_IMETHODIMP nsOutputStreamObserver::OnWrite(nsIOutputStream *outStr, PRUint32 amount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void onFull (in nsIOutputStream outStr); */
NS_IMETHODIMP nsOutputStreamObserver::OnFull(nsIOutputStream *outStr)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIObservableOutputStream_h__ */
