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

#ifndef __gen_nsIFileTransportService_h__
#define __gen_nsIFileTransportService_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 nsITransport; /* forward declaration */

class nsIEventSinkGetter; /* forward declaration */

class nsIInputStream; /* forward declaration */

class nsIRunnable; /* forward declaration */

class nsIFile; /* forward declaration */

class nsIStreamIO; /* forward declaration */


/* starting interface:    nsIFileTransportService */
#define NS_IFILETRANSPORTSERVICE_IID_STR "57211a60-8c45-11d3-93ac-00104ba0fd40"

#define NS_IFILETRANSPORTSERVICE_IID \
  {0x57211a60, 0x8c45, 0x11d3, \
    { 0x93, 0xac, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40 }}

class NS_NO_VTABLE nsIFileTransportService : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IFILETRANSPORTSERVICE_IID)

  /* nsITransport createTransport (in nsIFile file, in long ioFlags, in long perm, in boolean closeStreamWhenDone); */
  NS_IMETHOD CreateTransport(nsIFile *file, PRInt32 ioFlags, PRInt32 perm, PRBool closeStreamWhenDone, nsITransport **_retval) = 0;

  /* nsITransport createTransportFromStream (in AUTF8String name, in nsIInputStream fromStream, in ACString contentType, in ACString contentCharset, in long contentLength, in boolean closeStreamWhenDone); */
  NS_IMETHOD CreateTransportFromStream(const nsACString & name, nsIInputStream *fromStream, const nsACString & contentType, const nsACString & contentCharset, PRInt32 contentLength, PRBool closeStreamWhenDone, nsITransport **_retval) = 0;

  /* nsITransport createTransportFromStreamIO (in nsIStreamIO io, in boolean closeStreamWhenDone); */
  NS_IMETHOD CreateTransportFromStreamIO(nsIStreamIO *io, PRBool closeStreamWhenDone, nsITransport **_retval) = 0;

  /* void dispatchRequest (in nsIRunnable runnable); */
  NS_IMETHOD DispatchRequest(nsIRunnable *runnable) = 0;

  /* void processPendingRequests (); */
  NS_IMETHOD ProcessPendingRequests(void) = 0;

  /* void shutdown (); */
  NS_IMETHOD Shutdown(void) = 0;

  /**
	 * Total number of transports currently alive
	 */
  /* readonly attribute unsigned long totalTransportCount; */
  NS_IMETHOD GetTotalTransportCount(PRUint32 *aTotalTransportCount) = 0;

  /**
	 * A number of transports with I/O operation currently in-progress
	 */
  /* readonly attribute unsigned long inUseTransportCount; */
  NS_IMETHOD GetInUseTransportCount(PRUint32 *aInUseTransportCount) = 0;

  /**
	 * A number of transports connected/opened
	 */
  /* readonly attribute unsigned long connectedTransportCount; */
  NS_IMETHOD GetConnectedTransportCount(PRUint32 *aConnectedTransportCount) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIFILETRANSPORTSERVICE \
  NS_IMETHOD CreateTransport(nsIFile *file, PRInt32 ioFlags, PRInt32 perm, PRBool closeStreamWhenDone, nsITransport **_retval); \
  NS_IMETHOD CreateTransportFromStream(const nsACString & name, nsIInputStream *fromStream, const nsACString & contentType, const nsACString & contentCharset, PRInt32 contentLength, PRBool closeStreamWhenDone, nsITransport **_retval); \
  NS_IMETHOD CreateTransportFromStreamIO(nsIStreamIO *io, PRBool closeStreamWhenDone, nsITransport **_retval); \
  NS_IMETHOD DispatchRequest(nsIRunnable *runnable); \
  NS_IMETHOD ProcessPendingRequests(void); \
  NS_IMETHOD Shutdown(void); \
  NS_IMETHOD GetTotalTransportCount(PRUint32 *aTotalTransportCount); \
  NS_IMETHOD GetInUseTransportCount(PRUint32 *aInUseTransportCount); \
  NS_IMETHOD GetConnectedTransportCount(PRUint32 *aConnectedTransportCount); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIFILETRANSPORTSERVICE(_to) \
  NS_IMETHOD CreateTransport(nsIFile *file, PRInt32 ioFlags, PRInt32 perm, PRBool closeStreamWhenDone, nsITransport **_retval) { return _to CreateTransport(file, ioFlags, perm, closeStreamWhenDone, _retval); } \
  NS_IMETHOD CreateTransportFromStream(const nsACString & name, nsIInputStream *fromStream, const nsACString & contentType, const nsACString & contentCharset, PRInt32 contentLength, PRBool closeStreamWhenDone, nsITransport **_retval) { return _to CreateTransportFromStream(name, fromStream, contentType, contentCharset, contentLength, closeStreamWhenDone, _retval); } \
  NS_IMETHOD CreateTransportFromStreamIO(nsIStreamIO *io, PRBool closeStreamWhenDone, nsITransport **_retval) { return _to CreateTransportFromStreamIO(io, closeStreamWhenDone, _retval); } \
  NS_IMETHOD DispatchRequest(nsIRunnable *runnable) { return _to DispatchRequest(runnable); } \
  NS_IMETHOD ProcessPendingRequests(void) { return _to ProcessPendingRequests(); } \
  NS_IMETHOD Shutdown(void) { return _to Shutdown(); } \
  NS_IMETHOD GetTotalTransportCount(PRUint32 *aTotalTransportCount) { return _to GetTotalTransportCount(aTotalTransportCount); } \
  NS_IMETHOD GetInUseTransportCount(PRUint32 *aInUseTransportCount) { return _to GetInUseTransportCount(aInUseTransportCount); } \
  NS_IMETHOD GetConnectedTransportCount(PRUint32 *aConnectedTransportCount) { return _to GetConnectedTransportCount(aConnectedTransportCount); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIFILETRANSPORTSERVICE(_to) \
  NS_IMETHOD CreateTransport(nsIFile *file, PRInt32 ioFlags, PRInt32 perm, PRBool closeStreamWhenDone, nsITransport **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateTransport(file, ioFlags, perm, closeStreamWhenDone, _retval); } \
  NS_IMETHOD CreateTransportFromStream(const nsACString & name, nsIInputStream *fromStream, const nsACString & contentType, const nsACString & contentCharset, PRInt32 contentLength, PRBool closeStreamWhenDone, nsITransport **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateTransportFromStream(name, fromStream, contentType, contentCharset, contentLength, closeStreamWhenDone, _retval); } \
  NS_IMETHOD CreateTransportFromStreamIO(nsIStreamIO *io, PRBool closeStreamWhenDone, nsITransport **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->CreateTransportFromStreamIO(io, closeStreamWhenDone, _retval); } \
  NS_IMETHOD DispatchRequest(nsIRunnable *runnable) { return !_to ? NS_ERROR_NULL_POINTER : _to->DispatchRequest(runnable); } \
  NS_IMETHOD ProcessPendingRequests(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->ProcessPendingRequests(); } \
  NS_IMETHOD Shutdown(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->Shutdown(); } \
  NS_IMETHOD GetTotalTransportCount(PRUint32 *aTotalTransportCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetTotalTransportCount(aTotalTransportCount); } \
  NS_IMETHOD GetInUseTransportCount(PRUint32 *aInUseTransportCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetInUseTransportCount(aInUseTransportCount); } \
  NS_IMETHOD GetConnectedTransportCount(PRUint32 *aConnectedTransportCount) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetConnectedTransportCount(aConnectedTransportCount); } 

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

/* Header file */
class nsFileTransportService : public nsIFileTransportService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIFILETRANSPORTSERVICE

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsFileTransportService, nsIFileTransportService)

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

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

/* nsITransport createTransport (in nsIFile file, in long ioFlags, in long perm, in boolean closeStreamWhenDone); */
NS_IMETHODIMP nsFileTransportService::CreateTransport(nsIFile *file, PRInt32 ioFlags, PRInt32 perm, PRBool closeStreamWhenDone, nsITransport **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsITransport createTransportFromStream (in AUTF8String name, in nsIInputStream fromStream, in ACString contentType, in ACString contentCharset, in long contentLength, in boolean closeStreamWhenDone); */
NS_IMETHODIMP nsFileTransportService::CreateTransportFromStream(const nsACString & name, nsIInputStream *fromStream, const nsACString & contentType, const nsACString & contentCharset, PRInt32 contentLength, PRBool closeStreamWhenDone, nsITransport **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsITransport createTransportFromStreamIO (in nsIStreamIO io, in boolean closeStreamWhenDone); */
NS_IMETHODIMP nsFileTransportService::CreateTransportFromStreamIO(nsIStreamIO *io, PRBool closeStreamWhenDone, nsITransport **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void dispatchRequest (in nsIRunnable runnable); */
NS_IMETHODIMP nsFileTransportService::DispatchRequest(nsIRunnable *runnable)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void processPendingRequests (); */
NS_IMETHODIMP nsFileTransportService::ProcessPendingRequests()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void shutdown (); */
NS_IMETHODIMP nsFileTransportService::Shutdown()
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long totalTransportCount; */
NS_IMETHODIMP nsFileTransportService::GetTotalTransportCount(PRUint32 *aTotalTransportCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long inUseTransportCount; */
NS_IMETHODIMP nsFileTransportService::GetInUseTransportCount(PRUint32 *aInUseTransportCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute unsigned long connectedTransportCount; */
NS_IMETHODIMP nsFileTransportService::GetConnectedTransportCount(PRUint32 *aConnectedTransportCount)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

#define NS_FILETRANSPORTSERVICE_CID                  \
{ /* 2bb2b250-ea35-11d2-931b-00104ba0fd40 */         \
    0x2bb2b250,                                      \
    0xea35,                                          \
    0x11d2,                                          \
    {0x93, 0x1b, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40} \
}
/**
 * Status nsresult codes: used with nsIProgressEventSink::OnStatus 
 */
#define NS_NET_STATUS_READ_FROM NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 8)
#define NS_NET_STATUS_WROTE_TO  NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 9)

#endif /* __gen_nsIFileTransportService_h__ */
