00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KABC_RESOURCELDAPKIO_H
00023 #define KABC_RESOURCELDAPKIO_H
00024
00025 #include <kio/job.h>
00026 #include "kabc/resource.h"
00027
00028 namespace KABC {
00029
00030 class KABC_LDAPKIO_EXPORT ResourceLDAPKIO : public Resource
00031 {
00032 Q_OBJECT
00033
00034 public:
00035 enum CachePolicy {
00036 Cache_No,
00037 Cache_NoConnection,
00038 Cache_Always
00039 };
00040
00041 ResourceLDAPKIO();
00042 explicit ResourceLDAPKIO( const KConfigGroup &group );
00043 virtual ~ResourceLDAPKIO();
00047 virtual void init();
00048
00049 virtual void writeConfig( KConfigGroup &group );
00050
00051 virtual bool doOpen();
00052 virtual void doClose();
00053
00054 virtual Ticket *requestSaveTicket();
00055 virtual void releaseSaveTicket( Ticket *ticket );
00056
00057 virtual bool readOnly() const { return Resource::readOnly(); }
00058 virtual void setReadOnly( bool value );
00059
00060 virtual bool load();
00061 virtual bool asyncLoad();
00062 virtual bool save( Ticket *ticket );
00063 virtual bool asyncSave( Ticket *ticket );
00064
00065 virtual void removeAddressee( const Addressee &addr );
00066
00067 void setUser( const QString &user );
00068 QString user() const;
00069
00070 void setPassword( const QString &password );
00071 QString password() const;
00072
00073 void setRealm( const QString &realm );
00074 QString realm() const;
00075
00076 void setBindDN( const QString &binddn );
00077 QString bindDN() const;
00078
00079 void setDn( const QString &dn );
00080 QString dn() const;
00081
00082 void setHost( const QString &host );
00083 QString host() const;
00084
00085 void setPort( int port );
00086 int port() const;
00087
00088 void setVer( int ver );
00089 int ver() const;
00090
00091 void setSizeLimit( int sizelimit );
00092 int sizeLimit();
00093
00094 void setTimeLimit( int timelimit );
00095 int timeLimit();
00096
00097 void setFilter( const QString &filter );
00098 QString filter() const;
00099
00100 void setIsAnonymous( bool value );
00101 bool isAnonymous() const;
00102
00103 void setAttributes( const QMap<QString, QString> &attributes );
00104 QMap<QString, QString> attributes() const;
00105
00106 void setRDNPrefix( int value );
00107 int RDNPrefix() const;
00108
00109 void setIsTLS( bool value );
00110 bool isTLS() const;
00111
00112 void setIsSSL( bool value );
00113 bool isSSL() const;
00114
00115 void setIsSubTree( bool value );
00116 bool isSubTree() const;
00117
00118 void setIsSASL( bool value );
00119 bool isSASL() const;
00120
00121 void setMech( const QString &mech );
00122 QString mech() const;
00123
00124 void setCachePolicy( int pol );
00125 int cachePolicy() const;
00126
00127 void setAutoCache( bool value );
00128 bool autoCache();
00129
00130 QString cacheDst() const;
00131
00132 protected Q_SLOTS:
00133 void entries( KIO::Job *job, const KIO::UDSEntryList &list );
00134 void data( KIO::Job *job, const QByteArray &data );
00135 void result( KJob *job );
00136 void listResult( KJob *job );
00137 void syncLoadSaveResult( KJob *job );
00138 void saveResult( KJob *job );
00139 void saveData( KIO::Job *job, QByteArray &data );
00140 void loadCacheResult( KJob *job );
00141
00142 Q_SIGNALS:
00143 void leaveModality();
00144
00145 private:
00146 class Private;
00147 Private *const d;
00148 };
00149
00150 }
00151
00152 #endif