00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KLDAP_LDAPCONFIGWIDGET_H
00022 #define KLDAP_LDAPCONFIGWIDGET_H
00023
00024 #include <QtCore/QString>
00025 #include <QtGui/QWidget>
00026
00027 #include "ldapdn.h"
00028 #include "kldap_export.h"
00029 #include "ldapobject.h"
00030 #include "ldapserver.h"
00031 #include "ldapurl.h"
00032
00033 namespace KLDAP {
00034
00035 class LdapSearch;
00036
00044 class KLDAP_EXPORT LdapConfigWidget : public QWidget
00045 {
00046 Q_OBJECT
00047 Q_FLAGS( WinFlags )
00048 Q_ENUMS( Security )
00049 Q_ENUMS( Auth )
00050 Q_PROPERTY( WinFlags features READ features WRITE setFeatures )
00051 Q_PROPERTY( QString user READ user WRITE setUser )
00052 Q_PROPERTY( QString bindDn READ bindDn WRITE setBindDn )
00053 Q_PROPERTY( QString realm READ realm WRITE setRealm )
00054 Q_PROPERTY( QString password READ password WRITE setPassword )
00055 Q_PROPERTY( QString host READ host WRITE setHost )
00056 Q_PROPERTY( int port READ port WRITE setPort )
00057 Q_PROPERTY( int version READ version WRITE setVersion )
00058 Q_PROPERTY( LdapDN dn READ dn WRITE setDn )
00059 Q_PROPERTY( QString filter READ filter WRITE setFilter )
00060 Q_PROPERTY( QString mech READ mech WRITE setMech )
00061 Q_PROPERTY( Security security READ security WRITE setSecurity )
00062 Q_PROPERTY( Auth auth READ auth WRITE setAuth )
00063 Q_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit )
00064 Q_PROPERTY( int timeLimit READ timeLimit WRITE setTimeLimit )
00065 Q_PROPERTY( int pageSize READ pageSize WRITE setPageSize )
00066
00067 public:
00068
00069 enum WinFlag {
00070 W_USER = 0x1,
00071 W_BINDDN = 0x2,
00072 W_REALM = 0x4,
00073 W_PASS = 0x8,
00074 W_HOST = 0x10,
00075 W_PORT = 0x20,
00076 W_VER = 0x40,
00077 W_DN = 0x80,
00078 W_FILTER = 0x100,
00079 W_SECBOX = 0x200,
00080 W_AUTHBOX = 0x400,
00081 W_TIMELIMIT = 0x800,
00082 W_SIZELIMIT = 0x1000,
00083 W_PAGESIZE = 0x2000,
00084 W_ALL = 0x2fff
00085 };
00086
00087 typedef enum {
00088 None, SSL, TLS
00089 } Security;
00090 typedef enum {
00091 Anonymous, Simple, SASL
00092 } Auth;
00093
00094 Q_DECLARE_FLAGS( WinFlags, WinFlag )
00095
00096
00099 explicit LdapConfigWidget( QWidget *parent = 0, Qt::WFlags fl = 0 );
00101 explicit LdapConfigWidget( WinFlags flags, QWidget *parent = 0,
00102 Qt::WFlags fl = 0 );
00104 virtual ~LdapConfigWidget();
00105
00107 void setUser( const QString &user );
00109 QString user() const;
00110
00112 void setPassword( const QString &password );
00114 QString password() const;
00115
00120 void setBindDn( const QString &binddn );
00122 QString bindDn() const;
00123
00125 void setRealm( const QString &realm );
00127 QString realm() const;
00128
00130 void setHost( const QString &host );
00132 QString host() const;
00133
00135 void setPort( int port );
00137 int port() const;
00138
00140 void setVersion( int version );
00142 int version() const;
00143
00145 void setDn( const LdapDN &dn );
00147 LdapDN dn() const;
00148
00150 void setFilter( const QString &filter );
00152 QString filter() const;
00153
00155 void setMech( const QString &mech );
00157 QString mech() const;
00158
00163 void setSecurity( Security security );
00168 Security security() const;
00169
00174 void setAuth( Auth auth );
00179 Auth auth() const;
00180
00185 void setSizeLimit( int sizelimit );
00190 int sizeLimit() const;
00191
00196 void setTimeLimit( int timelimit );
00201 int timeLimit() const;
00202
00207 void setPageSize( int pagesize );
00212 int pageSize() const;
00213
00214 WinFlags features() const;
00215 void setFeatures( WinFlags features );
00216
00221 LdapUrl url() const;
00225 void setUrl( const LdapUrl &url );
00226
00230 LdapServer server() const;
00234 void setServer( const LdapServer &server );
00235
00236 private:
00237 class Private;
00238 Private *const d;
00239
00240 Q_PRIVATE_SLOT( d, void setLDAPPort() )
00241 Q_PRIVATE_SLOT( d, void setLDAPSPort() )
00242 Q_PRIVATE_SLOT( d, void setAnonymous( bool ) )
00243 Q_PRIVATE_SLOT( d, void setSimple( bool ) )
00244 Q_PRIVATE_SLOT( d, void setSASL( bool ) )
00245 Q_PRIVATE_SLOT( d, void queryDNClicked() )
00246 Q_PRIVATE_SLOT( d, void queryMechClicked() )
00247 Q_PRIVATE_SLOT( d, void loadData( KLDAP::LdapSearch*, const KLDAP::LdapObject& ) )
00248 Q_PRIVATE_SLOT( d, void loadResult( KLDAP::LdapSearch* ) )
00249 };
00250
00251 Q_DECLARE_OPERATORS_FOR_FLAGS( LdapConfigWidget::WinFlags )
00252
00253 }
00254
00255 #endif