7 #ifndef kpim_identity_h
8 #define kpim_identity_h
10 #include <kleo/enum.h>
12 #include <tdemacros.h>
15 #include <tqcstring.h>
16 #include <tqstringlist.h>
29 TDE_EXPORT TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Signature & sig );
30 TDE_EXPORT TQDataStream & operator>>( TQDataStream & stream,
KPIM::Signature & sig );
32 TDE_EXPORT TQDataStream & operator<<( TQDataStream & stream,
const KPIM::Identity & ident );
33 TDE_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 TDE_DEPRECATED TQCString pgpIdentity()
const {
return pgpEncryptionKey(); }
190 TDE_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 TDE_DEPRECATED TQString
emailAddr()
const {
return primaryEmailAddress(); }
216 TDE_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;
User identity information.
bool signatureIsCommand() const
TQString xface() const
a X-Face header for this identity
bool signatureIsInline() const
uint uoid() const
Unique Object Identifier for this identity.
TQString organization() const
The user's organization (optional)
TQCString smimeEncryptionKey() const
The user's S/MIME encryption key.
TQCString smimeSigningKey() const
The user's S/MIME signing key.
TQString signatureFile() const
name of the signature file (with path)
TQString identityName() const
Identity/nickname for this collection.
TQString fcc() const
The folder where sent messages from this identity will be stored by default.
bool operator<(const Identity &other) const
used for sorting
bool useSignatureFile() const
Inline or signature from a file.
TDE_DEPRECATED TQString emailAddr() const
email address (without the user name - only name@host)
TQString bcc() const
email addresses for the BCC: field
TQString signatureInlineText() const
inline signature
TQString fullName() const
Full name of the user.
TQString dictionary() const
dictionary which should be used for spell checking
TQString primaryEmailAddress() const
primary email address (without the user name - only name@host).
TQString transport() const
The transport that is set for this identity.
TQString replyToAddr() const
email address for the ReplyTo: field
TQCString pgpEncryptionKey() const
The user's OpenPGP encryption key.
const TQStringList & emailAliases() const
email address aliases
TQString drafts() const
The folder where draft messages from this identity will be stored by default.
bool signatureIsPlainFile() const
TQString templates() const
The folder where template messages from this identity will be stored by default.
TQString vCardFile() const
vCard to attach to outgoing emails
TQCString pgpSigningKey() const
The user's OpenPGP signing key.
abstraction of a signature (aka "footer").
Type
Type of signature (ie.
void setText(const TQString &text)
Set the signature text and mark this signature as being of "inline text" type.