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

#ifndef __gen_nsISocketProvider_h__
#define __gen_nsISocketProvider_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
#include "prio.h"

/* starting interface:    nsISocketProvider */
#define NS_ISOCKETPROVIDER_IID_STR "0906de00-5414-11d3-bbc8-0000861d1237"

#define NS_ISOCKETPROVIDER_IID \
  {0x0906de00, 0x5414, 0x11d3, \
    { 0xbb, 0xc8, 0x00, 0x00, 0x86, 0x1d, 0x12, 0x37 }}

class NS_NO_VTABLE nsISocketProvider : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISOCKETPROVIDER_IID)

  /* void NewSocket (in string host, in long port, in string proxyHost, in long proxyPort, out nsFileDescStar fileDesc, out nsISupports securityInfo); */
  NS_IMETHOD NewSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * *fileDesc, nsISupports **securityInfo) = 0;

  /* void AddToSocket (in string host, in long port, in string proxyHost, in long proxyPort, in nsFileDescStar fileDesc, out nsISupports securityInfo); */
  NS_IMETHOD AddToSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * fileDesc, nsISupports **securityInfo) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSISOCKETPROVIDER \
  NS_IMETHOD NewSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * *fileDesc, nsISupports **securityInfo); \
  NS_IMETHOD AddToSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * fileDesc, nsISupports **securityInfo); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSISOCKETPROVIDER(_to) \
  NS_IMETHOD NewSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * *fileDesc, nsISupports **securityInfo) { return _to NewSocket(host, port, proxyHost, proxyPort, fileDesc, securityInfo); } \
  NS_IMETHOD AddToSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * fileDesc, nsISupports **securityInfo) { return _to AddToSocket(host, port, proxyHost, proxyPort, fileDesc, securityInfo); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSISOCKETPROVIDER(_to) \
  NS_IMETHOD NewSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * *fileDesc, nsISupports **securityInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewSocket(host, port, proxyHost, proxyPort, fileDesc, securityInfo); } \
  NS_IMETHOD AddToSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * fileDesc, nsISupports **securityInfo) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddToSocket(host, port, proxyHost, proxyPort, fileDesc, securityInfo); } 

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

/* Header file */
class nsSocketProvider : public nsISocketProvider
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSISOCKETPROVIDER

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsSocketProvider, nsISocketProvider)

nsSocketProvider::nsSocketProvider()
{
  /* member initializers and constructor code */
}

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

/* void NewSocket (in string host, in long port, in string proxyHost, in long proxyPort, out nsFileDescStar fileDesc, out nsISupports securityInfo); */
NS_IMETHODIMP nsSocketProvider::NewSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * *fileDesc, nsISupports **securityInfo)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void AddToSocket (in string host, in long port, in string proxyHost, in long proxyPort, in nsFileDescStar fileDesc, out nsISupports securityInfo); */
NS_IMETHODIMP nsSocketProvider::AddToSocket(const char *host, PRInt32 port, const char *proxyHost, PRInt32 proxyPort, PRFileDesc * fileDesc, nsISupports **securityInfo)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

#define NS_NETWORK_SOCKET_CONTRACTID                "@mozilla.org/network/socket;1"
#define NS_NETWORK_SOCKET_CONTRACTID_PREFIX         NS_NETWORK_SOCKET_CONTRACTID "?type="
#define NS_NETWORK_SOCKET_CONTRACTID_PREFIX_LENGTH  41 // strlen(NS_NETWORK_SOCKET_CONTRACTID_PREFIX)
#define NS_ERROR_UNKNOWN_SOCKET_TYPE            NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 51)
#define NS_ERROR_SOCKET_CREATE_FAILED           NS_ERROR_GENERATE_FAILURE(NS_ERROR_MODULE_NETWORK, 52)

#endif /* __gen_nsISocketProvider_h__ */
