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

#ifndef __gen_nsIProtocolProxyService_h__
#define __gen_nsIProtocolProxyService_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 nsIProxyInfo; /* forward declaration */

class nsIChannel; /* forward declaration */

class nsIURI; /* forward declaration */


/* starting interface:    nsIProtocolProxyService */
#define NS_IPROTOCOLPROXYSERVICE_IID_STR "ec2da5ae-eb2e-11d8-9782-0004e22243f8"

#define NS_IPROTOCOLPROXYSERVICE_IID \
  {0xec2da5ae, 0xeb2e, 0x11d8, \
    { 0x97, 0x82, 0x00, 0x04, 0xe2, 0x22, 0x43, 0xf8 }}

/**
 * nsIProtocolProxyService provides methods to access information about
 * various network proxies.
 */
class NS_NO_VTABLE nsIProtocolProxyService : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IPROTOCOLPROXYSERVICE_IID)

  /**
     * This attribute indicates whether or not support for proxies is enabled.
     */
  /* readonly attribute PRBool proxyEnabled; */
  NS_IMETHOD GetProxyEnabled(PRBool *aProxyEnabled) = 0;

  /**
     * This method returns a nsIProxyInfo instance that identifies a proxy to
     * be used for loading the given URL.  Otherwise, this method returns null
     * indicating that a direct connection should be used.
     *
     * @param aURI
     *        The URI to test.
     *
     * NOTE: If this proxy is unavailable, getFailoverForProxy may be called
     * to determine the correct secondary proxy to be used.
     *
     * NOTE: If the protocol handler for the given URI supports
     * nsIProxiedProtocolHandler, then the nsIProxyInfo instance returned
     * from examineForProxy may be passed to the newProxiedChannel method
     * to create a nsIChannel to the given URI that uses the specified proxy.
     *
     * NOTE: However, if the nsIProxyInfo type is "HTTP", then it means that
     * the given URI should be loaded using the HTTP protocol handler, which
     * also supports nsIProxiedProtocolHandler.
     *
     * @see nsIProxiedProtocolHandler::newProxiedChannel 
     */
  /* nsIProxyInfo examineForProxy (in nsIURI aURI); */
  NS_IMETHOD ExamineForProxy(nsIURI *aURI, nsIProxyInfo **_retval) = 0;

  /**
     * This method may be called to construct a nsIProxyInfo instance from
     * the given parameters.  This method may be useful in conjunction with
     * nsISocketTransportService::createTransport for creating, for example,
     * a SOCKS connection.
     *
     * @param aType
     *        The proxy type.  This is a string value that identifies the proxy
     *        type.  Standard values include:
     *          "HTTP"   - specifies a HTTP proxy
     *          "SOCKS"  - specifies a SOCKS version 5 proxy
     *          "SOCKS4" - specifies a SOCKS version 4 proxy
     *        The type name is case insensitive.  Other string values may be
     *        possible.
     * @param aHost
     *        The proxy hostname or IP address.
     * @param aPort
     *        The proxy port.
     * @param aFlags
     *        Flags associated with this connection.  See nsIProxyInfo.idl
     *        for currently defined flags.
     */
  /* nsIProxyInfo newProxyInfo (in ACString aType, in AUTF8String aHost, in long aPort, in unsigned long aFlags); */
  NS_IMETHOD NewProxyInfo(const nsACString & aType, const nsACString & aHost, PRInt32 aPort, PRUint32 aFlags, nsIProxyInfo **_retval) = 0;

  /**
     * This method may be called to re-configure proxy settings given a URI
     * to a new proxy auto config file.  This method may return before the
     * configuration actually takes affect (i.e., the URI may be loaded
     * asynchronously).
     *
     * @param aURI
     *        The location of the PAC file to load.
     */
  /* void configureFromPAC (in AUTF8String aURI); */
  NS_IMETHOD ConfigureFromPAC(const nsACString & aURI) = 0;

  /**
     * If the proxy identified by aProxyInfo is unavailable for some reason,
     * this method may be called to access an alternate proxy that may be used
     * instead.  As a side-effect, this method may affect future return values
     * from examineForProxy as well as from getFailoverProxy.
     *
     * @param aProxyInfo
     *        The proxy that was unavailable.
     * @param aURI
     *        The URI that was originally passed to ExamineForProxy.
     * @param aReason
     *        The error code corresponding to the proxy failure.  This value
     *        may be used to tune the delay before this proxy is used again.
     *
     * @throw NS_ERROR_NOT_AVAILABLE if there is no alternate proxy available.
     */
  /* nsIProxyInfo getFailoverForProxy (in nsIProxyInfo aProxyInfo, in nsIURI aURI, in nsresult aReason); */
  NS_IMETHOD GetFailoverForProxy(nsIProxyInfo *aProxyInfo, nsIURI *aURI, nsresult aReason, nsIProxyInfo **_retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIPROTOCOLPROXYSERVICE \
  NS_IMETHOD GetProxyEnabled(PRBool *aProxyEnabled); \
  NS_IMETHOD ExamineForProxy(nsIURI *aURI, nsIProxyInfo **_retval); \
  NS_IMETHOD NewProxyInfo(const nsACString & aType, const nsACString & aHost, PRInt32 aPort, PRUint32 aFlags, nsIProxyInfo **_retval); \
  NS_IMETHOD ConfigureFromPAC(const nsACString & aURI); \
  NS_IMETHOD GetFailoverForProxy(nsIProxyInfo *aProxyInfo, nsIURI *aURI, nsresult aReason, nsIProxyInfo **_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIPROTOCOLPROXYSERVICE(_to) \
  NS_IMETHOD GetProxyEnabled(PRBool *aProxyEnabled) { return _to GetProxyEnabled(aProxyEnabled); } \
  NS_IMETHOD ExamineForProxy(nsIURI *aURI, nsIProxyInfo **_retval) { return _to ExamineForProxy(aURI, _retval); } \
  NS_IMETHOD NewProxyInfo(const nsACString & aType, const nsACString & aHost, PRInt32 aPort, PRUint32 aFlags, nsIProxyInfo **_retval) { return _to NewProxyInfo(aType, aHost, aPort, aFlags, _retval); } \
  NS_IMETHOD ConfigureFromPAC(const nsACString & aURI) { return _to ConfigureFromPAC(aURI); } \
  NS_IMETHOD GetFailoverForProxy(nsIProxyInfo *aProxyInfo, nsIURI *aURI, nsresult aReason, nsIProxyInfo **_retval) { return _to GetFailoverForProxy(aProxyInfo, aURI, aReason, _retval); } 

/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
#define NS_FORWARD_SAFE_NSIPROTOCOLPROXYSERVICE(_to) \
  NS_IMETHOD GetProxyEnabled(PRBool *aProxyEnabled) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetProxyEnabled(aProxyEnabled); } \
  NS_IMETHOD ExamineForProxy(nsIURI *aURI, nsIProxyInfo **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ExamineForProxy(aURI, _retval); } \
  NS_IMETHOD NewProxyInfo(const nsACString & aType, const nsACString & aHost, PRInt32 aPort, PRUint32 aFlags, nsIProxyInfo **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->NewProxyInfo(aType, aHost, aPort, aFlags, _retval); } \
  NS_IMETHOD ConfigureFromPAC(const nsACString & aURI) { return !_to ? NS_ERROR_NULL_POINTER : _to->ConfigureFromPAC(aURI); } \
  NS_IMETHOD GetFailoverForProxy(nsIProxyInfo *aProxyInfo, nsIURI *aURI, nsresult aReason, nsIProxyInfo **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetFailoverForProxy(aProxyInfo, aURI, aReason, _retval); } 

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

/* Header file */
class nsProtocolProxyService : public nsIProtocolProxyService
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIPROTOCOLPROXYSERVICE

  nsProtocolProxyService();

private:
  ~nsProtocolProxyService();

protected:
  /* additional members */
};

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsProtocolProxyService, nsIProtocolProxyService)

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

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

/* readonly attribute PRBool proxyEnabled; */
NS_IMETHODIMP nsProtocolProxyService::GetProxyEnabled(PRBool *aProxyEnabled)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIProxyInfo examineForProxy (in nsIURI aURI); */
NS_IMETHODIMP nsProtocolProxyService::ExamineForProxy(nsIURI *aURI, nsIProxyInfo **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIProxyInfo newProxyInfo (in ACString aType, in AUTF8String aHost, in long aPort, in unsigned long aFlags); */
NS_IMETHODIMP nsProtocolProxyService::NewProxyInfo(const nsACString & aType, const nsACString & aHost, PRInt32 aPort, PRUint32 aFlags, nsIProxyInfo **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void configureFromPAC (in AUTF8String aURI); */
NS_IMETHODIMP nsProtocolProxyService::ConfigureFromPAC(const nsACString & aURI)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsIProxyInfo getFailoverForProxy (in nsIProxyInfo aProxyInfo, in nsIURI aURI, in nsresult aReason); */
NS_IMETHODIMP nsProtocolProxyService::GetFailoverForProxy(nsIProxyInfo *aProxyInfo, nsIURI *aURI, nsresult aReason, nsIProxyInfo **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsIProtocolProxyService_h__ */
