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

#ifndef __gen_nsIHttpAuthenticator_h__
#define __gen_nsIHttpAuthenticator_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 nsIHttpChannel; /* forward declaration */


/* starting interface:    nsIHttpAuthenticator */
#define NS_IHTTPAUTHENTICATOR_IID_STR "5c6a8dda-0417-4694-807d-aa504699224e"

#define NS_IHTTPAUTHENTICATOR_IID \
  {0x5c6a8dda, 0x0417, 0x4694, \
    { 0x80, 0x7d, 0xaa, 0x50, 0x46, 0x99, 0x22, 0x4e }}

class NS_NO_VTABLE nsIHttpAuthenticator : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_IHTTPAUTHENTICATOR_IID)

  /**
     * Called to generate the authentication credentials for a particular
     * server/proxy challenge.
     *
     * @param channel   - the http channel requesting credentials
     * @param challenge - the server specified auth challenge
     * @param username  - the username from which to generate credentials
     * @param password  - the password from which to generate credentials
     * @param extra     - additional information stored in the auth cache
     */
  /* string generateCredentials (in nsIHttpChannel channel, in string challenge, in wstring username, in wstring password, in nsISupports metadata); */
  NS_IMETHOD GenerateCredentials(nsIHttpChannel *channel, const char *challenge, const PRUnichar *username, const PRUnichar *password, nsISupports *metadata, char **_retval) = 0;

  /**
     * indicates if credentials returned from GenerateCredentials can be reused
     */
  /* boolean areCredentialsReusable (); */
  NS_IMETHOD AreCredentialsReusable(PRBool *_retval) = 0;

  /**
     * indicates if the challenge requires a new username/password (e.g.,
     * if the response was invalid because the nonce has timed out, then
     * the old username/password is still valid).
     */
  /* boolean challengeRequiresUserPass (in string challenge); */
  NS_IMETHOD ChallengeRequiresUserPass(const char *challenge, PRBool *_retval) = 0;

  /**
     * allocate authenticator specific metadata implementation.  implementations
     * that don't need to store extra data in the auth cache can simply return NULL.
     */
  /* nsISupports allocateMetaData (); */
  NS_IMETHOD AllocateMetaData(nsISupports **_retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSIHTTPAUTHENTICATOR \
  NS_IMETHOD GenerateCredentials(nsIHttpChannel *channel, const char *challenge, const PRUnichar *username, const PRUnichar *password, nsISupports *metadata, char **_retval); \
  NS_IMETHOD AreCredentialsReusable(PRBool *_retval); \
  NS_IMETHOD ChallengeRequiresUserPass(const char *challenge, PRBool *_retval); \
  NS_IMETHOD AllocateMetaData(nsISupports **_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSIHTTPAUTHENTICATOR(_to) \
  NS_IMETHOD GenerateCredentials(nsIHttpChannel *channel, const char *challenge, const PRUnichar *username, const PRUnichar *password, nsISupports *metadata, char **_retval) { return _to GenerateCredentials(channel, challenge, username, password, metadata, _retval); } \
  NS_IMETHOD AreCredentialsReusable(PRBool *_retval) { return _to AreCredentialsReusable(_retval); } \
  NS_IMETHOD ChallengeRequiresUserPass(const char *challenge, PRBool *_retval) { return _to ChallengeRequiresUserPass(challenge, _retval); } \
  NS_IMETHOD AllocateMetaData(nsISupports **_retval) { return _to AllocateMetaData(_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_NSIHTTPAUTHENTICATOR(_to) \
  NS_IMETHOD GenerateCredentials(nsIHttpChannel *channel, const char *challenge, const PRUnichar *username, const PRUnichar *password, nsISupports *metadata, char **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateCredentials(channel, challenge, username, password, metadata, _retval); } \
  NS_IMETHOD AreCredentialsReusable(PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->AreCredentialsReusable(_retval); } \
  NS_IMETHOD ChallengeRequiresUserPass(const char *challenge, PRBool *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->ChallengeRequiresUserPass(challenge, _retval); } \
  NS_IMETHOD AllocateMetaData(nsISupports **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->AllocateMetaData(_retval); } 

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

/* Header file */
class nsHttpAuthenticator : public nsIHttpAuthenticator
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIHTTPAUTHENTICATOR

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsHttpAuthenticator, nsIHttpAuthenticator)

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

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

/* string generateCredentials (in nsIHttpChannel channel, in string challenge, in wstring username, in wstring password, in nsISupports metadata); */
NS_IMETHODIMP nsHttpAuthenticator::GenerateCredentials(nsIHttpChannel *channel, const char *challenge, const PRUnichar *username, const PRUnichar *password, nsISupports *metadata, char **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean areCredentialsReusable (); */
NS_IMETHODIMP nsHttpAuthenticator::AreCredentialsReusable(PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* boolean challengeRequiresUserPass (in string challenge); */
NS_IMETHODIMP nsHttpAuthenticator::ChallengeRequiresUserPass(const char *challenge, PRBool *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* nsISupports allocateMetaData (); */
NS_IMETHODIMP nsHttpAuthenticator::AllocateMetaData(nsISupports **_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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

#define NS_HTTP_AUTHENTICATOR_CONTRACTID_PREFIX \
    "@mozilla.org/network/http-authenticator;1?scheme="

#endif /* __gen_nsIHttpAuthenticator_h__ */
