00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KLDAP_LDAPCONNECTION_H
00022 #define KLDAP_LDAPCONNECTION_H
00023
00024 #include <QtCore/QString>
00025
00026 #include "ldapurl.h"
00027 #include "ldapserver.h"
00028 #include "kldap_export.h"
00029
00030 namespace KLDAP {
00031
00036 class KLDAP_EXPORT LdapConnection
00037 {
00038 public:
00039
00040 enum SASL_Fields {
00041 SASL_Authname = 0x1,
00042 SASL_Authzid = 0x2,
00043 SASL_Realm = 0x4,
00044 SASL_Password = 0x8
00045 };
00046
00048 LdapConnection();
00050 explicit LdapConnection( const LdapUrl &url );
00052 explicit LdapConnection( const LdapServer &server );
00053
00054 virtual ~LdapConnection();
00055
00060 void setUrl( const LdapUrl &url );
00065 const LdapServer &server() const;
00070 void setServer( const LdapServer &server );
00071
00078 int connect();
00082 QString connectionError() const;
00086 void close();
00087
00089 bool setSizeLimit( int sizelimit );
00091 int sizeLimit() const;
00092
00094 bool setTimeLimit( int timelimit );
00096 int timeLimit() const;
00097
00100 int getOption( int option, void *value ) const;
00103 int setOption( int option, void *value );
00104
00106 int ldapErrorCode() const;
00108 QString ldapErrorString() const;
00110 static QString errorString( int code );
00111
00113 QString saslErrorString() const;
00114
00119 void *handle() const;
00120
00125 void *saslHandle() const;
00126
00127 private:
00128 class LdapConnectionPrivate;
00129 LdapConnectionPrivate *const d;
00130
00131 Q_DISABLE_COPY( LdapConnection )
00132 };
00133
00134 }
00135
00136 #endif