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

#ifndef __gen_nsIPipe_h__
#define __gen_nsIPipe_h__

#include "nsISupports.h"

class nsIPipe; /* forward declaration */

class nsIMemory; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIOutputStream; /* forward declaration */


/* starting interface:    nsIPipe */
#define NS_IPIPE_IID_STR "f4211abc-61b3-11d4-9877-00c04fa0cf4a"

#define NS_IPIPE_IID \
  {0xf4211abc, 0x61b3, 0x11d4, \
    { 0x98, 0x77, 0x00, 0xc0, 0x4f, 0xa0, 0xcf, 0x4a }}

class NS_NO_VTABLE nsIPipe : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPIPE_IID)

  /* void initialize (in unsigned long segmentSize, in unsigned long maxSize, in boolean nonBlockingInput, in boolean nonBlockingOutput, in nsIMemory segmentAllocator); */
  NS_IMETHOD Initialize(PRUint32 segmentSize, PRUint32 maxSize, PRBool nonBlockingInput, PRBool nonBlockingOutput, nsIMemory *segmentAllocator) = 0;

  /* readonly attribute nsIInputStream inputStream; */
  NS_IMETHOD GetInputStream(nsIInputStream * *aInputStream) = 0;

  /* readonly attribute nsIOutputStream outputStream; */
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPIPE \
  NS_IMETHOD Initialize(PRUint32 segmentSize, PRUint32 maxSize, PRBool nonBlockingInput, PRBool nonBlockingOutput, nsIMemory *segmentAllocator); \
  NS_IMETHOD GetInputStream(nsIInputStream * *aInputStream); \
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPIPE(_to) \
  NS_IMETHOD Initialize(PRUint32 segmentSize, PRUint32 maxSize, PRBool nonBlockingInput, PRBool nonBlockingOutput, nsIMemory *segmentAllocator) { return _to ## Initialize(segmentSize, maxSize, nonBlockingInput, nonBlockingOutput, segmentAllocator); } \
  NS_IMETHOD GetInputStream(nsIInputStream * *aInputStream) { return _to ## GetInputStream(aInputStream); } \
  NS_IMETHOD GetOutputStream(nsIOutputStream * *aOutputStream) { return _to ## GetOutputStream(aOutputStream); } 

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

/* Header file */
class nsPipe : public nsIPipe
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPIPE

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsPipe, nsIPipe)

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

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

/* void initialize (in unsigned long segmentSize, in unsigned long maxSize, in boolean nonBlockingInput, in boolean nonBlockingOutput, in nsIMemory segmentAllocator); */
NS_IMETHODIMP nsPipe::Initialize(PRUint32 segmentSize, PRUint32 maxSize, PRBool nonBlockingInput, PRBool nonBlockingOutput, nsIMemory *segmentAllocator)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIInputStream inputStream; */
NS_IMETHODIMP nsPipe::GetInputStream(nsIInputStream * *aInputStream)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute nsIOutputStream outputStream; */
NS_IMETHODIMP nsPipe::GetOutputStream(nsIOutputStream * *aOutputStream)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

#define NS_PIPE_DEFAULT_SEGMENT_SIZE    4096
#define NS_PIPE_DEFAULT_BUFFER_SIZE     (1024*1024)
extern NS_COM nsresult
NS_NewPipe(nsIInputStream* *inStrResult,
           nsIOutputStream* *outStrResult,
           PRUint32 segmentSize = NS_PIPE_DEFAULT_SEGMENT_SIZE,
           PRUint32 maxSize = NS_PIPE_DEFAULT_BUFFER_SIZE,
           PRBool nonBlockingInput = PR_FALSE,
           PRBool nonBlockingOutput = PR_FALSE,
           nsIMemory* segmentAllocator = nsnull);

#endif /* __gen_nsIPipe_h__ */
