7 #ifndef kpim_identity_h
8 #define kpim_identity_h
10 #include <kleo/enum.h>
12 #include <tdepimmacros.h>
15 #include <tqcstring.h>
16 #include <tqstringlist.h>
29 KDE_EXPORT TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Signature & sig );
30 KDE_EXPORT TQDataStream & operator>>( TQDataStream & stream,
KPIM::Signature & sig );
32 KDE_EXPORT TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Identity & ident );
33 KDE_EXPORT TQDataStream & operator>>( TQDataStream & stream,
KPIM::Identity & ident );
42 friend TQDataStream & KPIM::operator<<( TQDataStream & stream,
const Signature & sig );
43 friend TQDataStream & KPIM::operator>>( TQDataStream & stream,
Signature & sig );
47 enum Type { Disabled = 0, Inlined = 1, FromFile = 2, FromCommand = 3 };
50 bool operator==(
const Signature & other )
const;
57 Signature(
const TQString & url,
bool isExecutable );
60 TQString rawText(
bool * ok=0 )
const;
64 TQString withSeparator(
bool * ok=0 )
const;
68 void setText(
const TQString & text ) { mText = text; }
69 TQString text()
const {
return mText; }
73 void setUrl(
const TQString & url,
bool isExecutable=
false );
74 TQString url()
const {
return mUrl; }
78 void setType( Type type ) { mType = type; }
81 void writeConfig( TDEConfigBase * config )
const;
82 void readConfig(
const TDEConfigBase * config );
85 TQString textFromFile(
bool * ok )
const;
86 TQString textFromCommand(
bool * ok )
const;
100 friend class IdentityManager;
102 friend TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Identity & ident );
103 friend TQDataStream & operator>>( TQDataStream & stream,
KPIM::Identity & ident );
106 typedef TQValueList<Identity> List;
109 bool operator==(
const Identity & other )
const;
111 bool operator!=(
const Identity & other )
const {
112 return !operator==( other );
117 if ( isDefault() )
return true;
121 bool operator>(
const Identity & other )
const {
122 if ( isDefault() )
return false;
126 bool operator<=(
const Identity & other )
const {
127 return !operator>( other );
129 bool operator>=(
const Identity & other )
const {
130 return !operator<( other );
134 explicit Identity(
const TQString &
id=TQString(),
135 const TQString & realName=TQString(),
136 const TQString & emailAddr=TQString(),
137 const TQString & organization=TQString(),
138 const TQString & replyToAddress=TQString() );
146 void readConfig(
const TDEConfigBase * );
150 void writeConfig( TDEConfigBase * )
const;
154 bool mailingAllowed()
const;
158 void setIdentityName(
const TQString & name );
164 uint
uoid()
const {
return mUoid; }
176 void setIsDefault(
bool flag );
178 void setUoid( uint aUoid ) { mUoid = aUoid; }
183 void setFullName(
const TQString&);
187 void setOrganization(
const TQString&);
189 KDE_DEPRECATED TQCString pgpIdentity()
const {
return pgpEncryptionKey(); }
190 KDE_DEPRECATED
void setPgpIdentity(
const TQCString & key ) {
191 setPGPEncryptionKey( key );
192 setPGPSigningKey( key );
197 void setPGPEncryptionKey(
const TQCString & key );
201 void setPGPSigningKey(
const TQCString & key );
205 void setSMIMEEncryptionKey(
const TQCString & key );
209 void setSMIMESigningKey(
const TQCString & key );
211 Kleo::CryptoMessageFormat preferredCryptoMessageFormat()
const {
return mPreferredCryptoMessageFormat; }
212 void setPreferredCryptoMessageFormat( Kleo::CryptoMessageFormat format ) { mPreferredCryptoMessageFormat = format; }
215 KDE_DEPRECATED TQString
emailAddr()
const {
return primaryEmailAddress(); }
216 KDE_DEPRECATED
void setEmailAddr(
const TQString & email ) { setPrimaryEmailAddress( email ); }
221 void setPrimaryEmailAddress(
const TQString & email );
225 void setEmailAliases(
const TQStringList & );
227 bool matchesEmailAddress(
const TQString & addr )
const;
231 void setVCardFile(
const TQString&);
235 TQString fullEmailAddr()
const;
239 void setReplyToAddr(
const TQString&);
242 TQString
bcc()
const {
return mBcc; }
243 void setBcc(
const TQString& aBcc) { mBcc = aBcc; }
245 void setSignature(
const Signature & sig ) { mSignature = sig; }
246 Signature & signature() {
return mSignature; }
247 const Signature & signature()
const {
return mSignature; }
259 void setSignatureFile(
const TQString&);
263 void setSignatureInlineText(
const TQString&);
274 TQString signatureText(
bool * ok=0)
const;
279 void setTransport(
const TQString&);
283 TQString
fcc()
const {
return mFcc; }
284 void setFcc(
const TQString&);
288 TQString
drafts()
const {
return mDrafts; }
289 void setDrafts(
const TQString&);
294 void setTemplates(
const TQString& );
298 void setDictionary(
const TQString& );
301 TQString
xface()
const {
return mXFace; }
302 void setXFace(
const TQString& );
303 bool isXFaceEnabled()
const {
return mXFaceEnabled; }
304 void setXFaceEnabled(
const bool );
306 static const Identity& null();
314 TQString mIdentity, mFullName, mEmailAddr, mOrganization;
315 TQStringList mEmailAliases;
316 TQString mReplyToAddr;
319 TQCString mPGPEncryptionKey, mPGPSigningKey, mSMIMEEncryptionKey, mSMIMESigningKey;
320 TQString mFcc, mDrafts, mTemplates, mTransport;
321 TQString mDictionary;
324 Signature mSignature;
326 Kleo::CryptoMessageFormat mPreferredCryptoMessageFormat;