22 #ifndef KABC_RESOURCELDAP_H
23 #define KABC_RESOURCELDAP_H
25 #include <tdeabc/resource.h>
26 #include <tdeabc/ldif.h>
27 #include <tdeio/job.h>
33 class KABC_EXPORT ResourceLDAPTDEIO :
public Resource
38 enum CachePolicy{ Cache_No, Cache_NoConnection, Cache_Always };
41 virtual ~ResourceLDAPTDEIO();
49 virtual bool doOpen();
50 virtual void doClose();
52 virtual Ticket *requestSaveTicket();
53 virtual void releaseSaveTicket( Ticket* );
55 virtual bool readOnly()
const {
return Resource::readOnly(); }
56 virtual void setReadOnly(
bool value );
59 virtual bool asyncLoad();
60 virtual bool save( Ticket * ticket );
61 virtual bool asyncSave( Ticket * ticket );
63 virtual void removeAddressee(
const Addressee& addr );
65 void setUser(
const TQString &user );
66 TQString user()
const;
68 void setPassword(
const TQString &password );
69 TQString password()
const;
71 void setRealm(
const TQString &realm );
72 TQString realm()
const;
74 void setBindDN(
const TQString &binddn );
75 TQString bindDN()
const;
77 void setDn(
const TQString &dn );
80 void setHost(
const TQString &host );
81 TQString host()
const;
83 void setPort(
int port );
86 void setVer(
int ver );
89 void setSizeLimit(
int sizelimit );
92 void setTimeLimit(
int timelimit );
95 void setFilter(
const TQString &filter );
96 TQString filter()
const;
98 void setIsAnonymous(
bool value );
99 bool isAnonymous()
const;
101 void setAttributes(
const TQMap<TQString, TQString> &attributes );
102 TQMap<TQString, TQString> attributes()
const;
104 void setRDNPrefix(
int value );
105 int RDNPrefix()
const;
107 void setIsTLS(
bool value );
110 void setIsSSL(
bool value );
113 void setIsSubTree(
bool value );
114 bool isSubTree()
const ;
116 void setIsSASL(
bool value );
117 bool isSASL()
const ;
119 void setMech(
const TQString &mech );
120 TQString mech()
const;
122 void setCachePolicy(
int pol );
123 int cachePolicy()
const;
125 void setAutoCache(
bool value );
128 TQString cacheDst()
const;
131 void entries( TDEIO::Job*,
const TDEIO::UDSEntryList& );
132 void data( TDEIO::Job*,
const TQByteArray& );
133 void result( TDEIO::Job* );
134 void listResult( TDEIO::Job* );
135 void syncLoadSaveResult( TDEIO::Job* );
136 void saveResult( TDEIO::Job* );
137 void saveData( TDEIO::Job*, TQByteArray& );
138 void loadCacheResult( TDEIO::Job* );
148 TQMap<TQString, TQString> mAttributes;
154 TQMap<TDEIO::Job*, TQByteArray> mJobMap;
156 TDEIO::Job *loadFromCache();
158 void activateCache();
160 TQCString addEntry(
const TQString &attr,
const TQString &value,
bool mod );
161 TQString findUid(
const TQString &uid );
162 bool AddresseeToLDIF( TQByteArray &ldif,
const Addressee &addr,
163 const TQString &olddn );
165 class ResourceLDAPTDEIOPrivate;
166 ResourceLDAPTDEIOPrivate *d;
static data, shared by ALL addressee objects
const TDEShortcut & save()