00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#ifndef LDAPCONFIGWIDGET_H
00022
#define LDAPCONFIGWIDGET_H
00023
00024
#include <qwidget.h>
00025
#include <qmap.h>
00026
#include <qstring.h>
00027
00028
#include <kabc/ldapurl.h>
00029
#include <kabc/ldif.h>
00030
#include <kio/job.h>
00031
00032
class QGridLayout;
00033
class QSpinBox;
00034
class QPushButton;
00035
class QCheckBox;
00036
class QRadioButton;
00037
class KComboBox;
00038
class KLineEdit;
00039
class KProgressDialog;
00040
00041
namespace KABC {
00042
00050 class LdapConfigWidget :
public QWidget
00051 {
00052 Q_OBJECT
00053 Q_PROPERTY( LCW_Flags flags READ flags WRITE setFlags )
00054 Q_PROPERTY(
QString user READ user WRITE
setUser )
00055 Q_PROPERTY(
QString password READ password WRITE
setPassword )
00056 Q_PROPERTY(
QString bindDN READ bindDN WRITE
setBindDN )
00057 Q_PROPERTY(
QString realm READ realm WRITE
setRealm )
00058 Q_PROPERTY(
QString host READ host WRITE
setHost )
00059 Q_PROPERTY(
int port READ port WRITE
setPort )
00060 Q_PROPERTY(
int ver READ ver WRITE
setVer )
00061 Q_PROPERTY(
QString dn READ dn WRITE
setDn )
00062 Q_PROPERTY(
QString filter READ filter WRITE
setFilter )
00063 Q_PROPERTY(
QString mech READ mech WRITE
setMech )
00064 Q_PROPERTY(
bool secNO READ
isSecNO WRITE
setSecNO )
00065 Q_PROPERTY(
bool secSSL READ
isSecSSL WRITE
setSecSSL )
00066 Q_PROPERTY(
bool secTLS READ
isSecSSL WRITE
setSecTLS )
00067 Q_PROPERTY(
bool authAnon READ
isAuthAnon WRITE
setAuthAnon )
00068 Q_PROPERTY(
bool authSimple READ
isAuthSimple WRITE
setAuthSimple )
00069 Q_PROPERTY(
bool authSASL READ
isAuthSASL WRITE
setAuthSASL )
00070 Q_PROPERTY(
int sizeLimit READ sizeLimit WRITE
setSizeLimit )
00071 Q_PROPERTY(
int timeLimit READ timeLimit WRITE
setTimeLimit )
00072 Q_SETS ( LCW_Flags )
00073
00074
public:
00075
00076
enum LCW_Flags {
00077 W_USER = 0x1,
00078 W_PASS = 0x2,
00079 W_BINDDN = 0x4,
00080 W_REALM = 0x8,
00081 W_HOST = 0x10,
00082 W_PORT = 0x20,
00083 W_VER = 0x40,
00084 W_DN = 0x80,
00085 W_FILTER = 0x100,
00086 W_SECBOX = 0x400,
00087 W_AUTHBOX = 0x800,
00088 W_TIMELIMIT = 0x1000,
00089 W_SIZELIMIT = 0x2000,
00090 W_ALL = 0xFFFFFFF
00091 };
00092
00096
LdapConfigWidget(
QWidget* parent = 0,
00097
const char* name = 0, WFlags fl = 0 );
00099
LdapConfigWidget(
int flags = W_ALL,
QWidget* parent = 0,
00100
const char* name = 0, WFlags fl = 0 );
00102
virtual ~LdapConfigWidget();
00103
00105
void setUser(
const QString &user );
00107
QString user()
const;
00108
00110
void setPassword(
const QString &password );
00112
QString password()
const;
00113
00118
void setBindDN(
const QString &binddn );
00120
QString bindDN()
const;
00121
00123
void setRealm(
const QString &realm );
00125
QString realm()
const;
00126
00128
void setHost(
const QString &host );
00130
QString host()
const;
00131
00133
void setPort(
int port );
00135
int port()
const;
00136
00138
void setVer(
int ver );
00140
int ver()
const;
00141
00143
void setDn(
const QString &dn );
00145
QString dn()
const;
00146
00148
void setFilter(
const QString &filter );
00150
QString filter()
const;
00151
00153
void setMech(
const QString &mech );
00155
QString mech()
const;
00156
00161
void setSecNO(
bool b =
true );
00166
bool isSecNO()
const;
00167
00172
void setSecTLS(
bool b =
true );
00177
bool isSecTLS()
const;
00178
00183
void setSecSSL(
bool b =
true );
00188
bool isSecSSL()
const;
00189
00194
void setAuthAnon(
bool b =
true );
00199
bool isAuthAnon()
const;
00200
00205
void setAuthSimple(
bool b =
true );
00210
bool isAuthSimple()
const;
00211
00216
void setAuthSASL(
bool b =
true );
00221
bool isAuthSASL()
const;
00222
00227
void setSizeLimit(
int sizelimit );
00232
int sizeLimit()
const;
00233
00238
void setTimeLimit(
int timelimit );
00243
int timeLimit()
const;
00244
00245
int flags()
const;
00246
void setFlags(
int flags );
00247
00252
KABC::LDAPUrl url()
const;
00253
00254
private slots:
00255
void setLDAPPort();
00256
void setLDAPSPort();
00257
void setAnonymous(
int state );
00258
void setSimple(
int state );
00259
void setSASL(
int state );
00260
void mQueryDNClicked();
00261
void mQueryMechClicked();
00262
void loadData( KIO::Job*,
const QByteArray& );
00263
void loadResult( KIO::Job* );
00264
private:
00265
00266
int mFlags;
00267
LDIF mLdif;
00268
QStringList mQResult;
00269
QString mAttr;
00270
00271
KLineEdit *mUser;
00272
KLineEdit *mPassword;
00273
KLineEdit *mHost;
00274
QSpinBox *mPort, *mVer, *mSizeLimit, *mTimeLimit;
00275
KLineEdit *mDn, *mBindDN, *mRealm;
00276
KLineEdit *mFilter;
00277
QRadioButton *mAnonymous,*mSimple,*mSASL;
00278
QCheckBox *mSubTree;
00279
QPushButton *mEditButton;
00280
QPushButton *mQueryMech;
00281
QRadioButton *mSecNO,*mSecTLS,*mSecSSL;
00282
KComboBox *mMech;
00283
00284
QString mErrorMsg;
00285
bool mCancelled;
00286
KProgressDialog *mProg;
00287
00288
QGridLayout *mainLayout;
00289
class LDAPConfigWidgetPrivate;
00290 LDAPConfigWidgetPrivate *d;
00291
00292
void sendQuery();
00293
void initWidget();
00294 };
00295 }
00296
00297
#endif