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

#ifndef __gen_nsILDAPConnection_h__
#define __gen_nsILDAPConnection_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 nsILDAPOperation; /* forward declaration */

class nsILDAPMessageListener; /* forward declaration */


/* starting interface:    nsILDAPConnection */
#define NS_ILDAPCONNECTION_IID_STR "337ad2fe-1dd2-11b2-89f8-aae1221ec86c"

#define NS_ILDAPCONNECTION_IID \
  {0x337ad2fe, 0x1dd2, 0x11b2, \
    { 0x89, 0xf8, 0xaa, 0xe1, 0x22, 0x1e, 0xc8, 0x6c }}

class NS_NO_VTABLE nsILDAPConnection : public nsISupports {
 public: 

  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ILDAPCONNECTION_IID)

  /**
     * the string version of lderrno
     */
  /* readonly attribute wstring errorString; */
  NS_IMETHOD GetErrorString(PRUnichar * *aErrorString) = 0;

  /**
     * DN to bind as.  use the init() method to set this.
     *
     * @exception NS_ERROR_OUT_OF_MEMORY
     */
  /* readonly attribute wstring bindName; */
  NS_IMETHOD GetBindName(PRUnichar * *aBindName) = 0;

  /** 
     * set up the connection.  
     *
     * @param aHost             server name for ldap_init()
     * @param aPort             server port number for ldap_init()
     *                          -1 == default port (389)
     * @param aBindName         DN to bind as
     *
     * @exception NS_ERROR_ILLEGAL_VALUE        null pointer passed in
     * @exception NS_ERROR_OUT_OF_MEMORY        ran out of memory
     * @exception NS_ERROR_OFFLINE              we are in off-line mode
     * @exception NS_ERROR_FAILURE              
     * @exception NS_ERROR_UNEXPECTED           internal error
     */
  /* void init (in string aHost, in short aPort, in wstring aBindName, in nsILDAPMessageListener aMessageListener); */
  NS_IMETHOD Init(const char *aHost, PRInt16 aPort, const PRUnichar *aBindName, nsILDAPMessageListener *aMessageListener) = 0;

  /**
     * Get information about the last error that occured on this connection.
     *
     * @param matched   if the server is returning LDAP_NO_SUCH_OBJECT, 
     *                  LDAP_ALIAS_PROBLEM, LDAP_INVALID_DN_SYNTAX, 
     *                  or LDAP_ALIAS_DEREF_PROBLEM, this will contain
     *                  the portion of DN that matches the entry that is 
     *                  closest to the requested entry
     *
     * @param s         additional error information from the server
     * 
     * @return          the error code, as defined in nsILDAPErrors.idl
     */
  /* long getLdErrno (out wstring matched, out wstring s); */
  NS_IMETHOD GetLdErrno(PRUnichar **matched, PRUnichar **s, PRInt32 *_retval) = 0;

};

/* Use this macro when declaring classes that implement this interface. */
#define NS_DECL_NSILDAPCONNECTION \
  NS_IMETHOD GetErrorString(PRUnichar * *aErrorString); \
  NS_IMETHOD GetBindName(PRUnichar * *aBindName); \
  NS_IMETHOD Init(const char *aHost, PRInt16 aPort, const PRUnichar *aBindName, nsILDAPMessageListener *aMessageListener); \
  NS_IMETHOD GetLdErrno(PRUnichar **matched, PRUnichar **s, PRInt32 *_retval); 

/* Use this macro to declare functions that forward the behavior of this interface to another object. */
#define NS_FORWARD_NSILDAPCONNECTION(_to) \
  NS_IMETHOD GetErrorString(PRUnichar * *aErrorString) { return _to GetErrorString(aErrorString); } \
  NS_IMETHOD GetBindName(PRUnichar * *aBindName) { return _to GetBindName(aBindName); } \
  NS_IMETHOD Init(const char *aHost, PRInt16 aPort, const PRUnichar *aBindName, nsILDAPMessageListener *aMessageListener) { return _to Init(aHost, aPort, aBindName, aMessageListener); } \
  NS_IMETHOD GetLdErrno(PRUnichar **matched, PRUnichar **s, PRInt32 *_retval) { return _to GetLdErrno(matched, s, _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_NSILDAPCONNECTION(_to) \
  NS_IMETHOD GetErrorString(PRUnichar * *aErrorString) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetErrorString(aErrorString); } \
  NS_IMETHOD GetBindName(PRUnichar * *aBindName) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetBindName(aBindName); } \
  NS_IMETHOD Init(const char *aHost, PRInt16 aPort, const PRUnichar *aBindName, nsILDAPMessageListener *aMessageListener) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aHost, aPort, aBindName, aMessageListener); } \
  NS_IMETHOD GetLdErrno(PRUnichar **matched, PRUnichar **s, PRInt32 *_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetLdErrno(matched, s, _retval); } 

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

/* Header file */
class nsLDAPConnection : public nsILDAPConnection
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSILDAPCONNECTION

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

/* Implementation file */
NS_IMPL_ISUPPORTS1(nsLDAPConnection, nsILDAPConnection)

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

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

/* readonly attribute wstring errorString; */
NS_IMETHODIMP nsLDAPConnection::GetErrorString(PRUnichar * *aErrorString)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* readonly attribute wstring bindName; */
NS_IMETHODIMP nsLDAPConnection::GetBindName(PRUnichar * *aBindName)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* void init (in string aHost, in short aPort, in wstring aBindName, in nsILDAPMessageListener aMessageListener); */
NS_IMETHODIMP nsLDAPConnection::Init(const char *aHost, PRInt16 aPort, const PRUnichar *aBindName, nsILDAPMessageListener *aMessageListener)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

/* long getLdErrno (out wstring matched, out wstring s); */
NS_IMETHODIMP nsLDAPConnection::GetLdErrno(PRUnichar **matched, PRUnichar **s, PRInt32 *_retval)
{
    return NS_ERROR_NOT_IMPLEMENTED;
}

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


#endif /* __gen_nsILDAPConnection_h__ */
