7 #ifndef kpim_identity_h
8 #define kpim_identity_h
10 #include <kleo/enum.h>
12 #include <kdepimmacros.h>
15 #include <tqcstring.h>
16 #include <tqstringlist.h>
36 friend TQDataStream & KPIM::operator<<( TQDataStream & stream,
const Signature & sig );
37 friend TQDataStream & KPIM::operator>>( TQDataStream & stream,
Signature & sig );
41 enum Type { Disabled = 0, Inlined = 1, FromFile = 2, FromCommand = 3 };
44 bool operator==(
const Signature & other )
const;
51 Signature(
const TQString & url,
bool isExecutable );
54 TQString rawText(
bool * ok=0 )
const;
58 TQString withSeparator(
bool * ok=0 )
const;
62 void setText(
const TQString & text ) { mText = text; }
63 TQString text()
const {
return mText; }
67 void setUrl(
const TQString & url,
bool isExecutable=
false );
68 TQString url()
const {
return mUrl; }
72 void setType( Type type ) { mType = type; }
75 void writeConfig( KConfigBase * config )
const;
76 void readConfig(
const KConfigBase * config );
79 TQString textFromFile(
bool * ok )
const;
80 TQString textFromCommand(
bool * ok )
const;
94 friend class IdentityManager;
96 friend TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Identity & ident );
97 friend TQDataStream & operator>>( TQDataStream & stream,
KPIM::Identity & ident );
100 typedef TQValueList<Identity> List;
103 bool operator==(
const Identity & other )
const;
105 bool operator!=(
const Identity & other )
const {
106 return !operator==( other );
111 if ( isDefault() )
return true;
115 bool operator>(
const Identity & other )
const {
116 if ( isDefault() )
return false;
120 bool operator<=(
const Identity & other )
const {
121 return !operator>( other );
123 bool operator>=(
const Identity & other )
const {
124 return !operator<( other );
128 explicit Identity(
const TQString &
id=TQString(),
129 const TQString & realName=TQString(),
130 const TQString & emailAddr=TQString(),
131 const TQString & organization=TQString(),
132 const TQString & replyToAddress=TQString() );
140 void readConfig(
const KConfigBase * );
144 void writeConfig( KConfigBase * )
const;
148 bool mailingAllowed()
const;
152 void setIdentityName(
const TQString & name );
158 uint
uoid()
const {
return mUoid; }
170 void setIsDefault(
bool flag );
172 void setUoid( uint aUoid ) { mUoid = aUoid; }
177 void setFullName(
const TQString&);
181 void setOrganization(
const TQString&);
183 KDE_DEPRECATED TQCString pgpIdentity()
const {
return pgpEncryptionKey(); }
184 KDE_DEPRECATED
void setPgpIdentity(
const TQCString & key ) {
185 setPGPEncryptionKey( key );
186 setPGPSigningKey( key );
191 void setPGPEncryptionKey(
const TQCString & key );
195 void setPGPSigningKey(
const TQCString & key );
199 void setSMIMEEncryptionKey(
const TQCString & key );
203 void setSMIMESigningKey(
const TQCString & key );
205 Kleo::CryptoMessageFormat preferredCryptoMessageFormat()
const {
return mPreferredCryptoMessageFormat; }
206 void setPreferredCryptoMessageFormat( Kleo::CryptoMessageFormat format ) { mPreferredCryptoMessageFormat = format; }
209 KDE_DEPRECATED TQString
emailAddr()
const {
return primaryEmailAddress(); }
210 KDE_DEPRECATED
void setEmailAddr(
const TQString & email ) { setPrimaryEmailAddress( email ); }
215 void setPrimaryEmailAddress(
const TQString & email );
219 void setEmailAliases(
const TQStringList & );
221 bool matchesEmailAddress(
const TQString & addr )
const;
225 void setVCardFile(
const TQString&);
229 TQString fullEmailAddr()
const;
233 void setReplyToAddr(
const TQString&);
236 TQString
bcc()
const {
return mBcc; }
237 void setBcc(
const TQString& aBcc) { mBcc = aBcc; }
239 void setSignature(
const Signature & sig ) { mSignature = sig; }
240 Signature & signature() {
return mSignature; }
241 const Signature & signature()
const {
return mSignature; }
253 void setSignatureFile(
const TQString&);
257 void setSignatureInlineText(
const TQString&);
268 TQString signatureText(
bool * ok=0)
const;
273 void setTransport(
const TQString&);
277 TQString
fcc()
const {
return mFcc; }
278 void setFcc(
const TQString&);
282 TQString
drafts()
const {
return mDrafts; }
283 void setDrafts(
const TQString&);
288 void setTemplates(
const TQString& );
292 void setDictionary(
const TQString& );
295 TQString
xface()
const {
return mXFace; }
296 void setXFace(
const TQString& );
297 bool isXFaceEnabled()
const {
return mXFaceEnabled; }
298 void setXFaceEnabled(
const bool );
300 static const Identity& null();
308 TQString mIdentity, mFullName, mEmailAddr, mOrganization;
309 TQStringList mEmailAliases;
310 TQString mReplyToAddr;
313 TQCString mPGPEncryptionKey, mPGPSigningKey, mSMIMEEncryptionKey, mSMIMESigningKey;
314 TQString mFcc, mDrafts, mTemplates, mTransport;
315 TQString mDictionary;
318 Signature mSignature;
320 Kleo::CryptoMessageFormat mPreferredCryptoMessageFormat;
323 KDE_EXPORT TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Signature & sig );
324 KDE_EXPORT TQDataStream & operator>>( TQDataStream & stream,
KPIM::Signature & sig );
326 KDE_EXPORT TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Identity & ident );
327 KDE_EXPORT TQDataStream & operator>>( TQDataStream & stream,
KPIM::Identity & ident );