22 #ifndef KPIMIDENTITES_IDENTITY_H
23 #define KPIMIDENTITES_IDENTITY_H
25 #include "kpimidentities_export.h"
26 #include "signature.h"
28 #include <kdemacros.h>
30 #include <QtCore/QString>
31 #include <QtCore/QStringList>
32 #include <QtCore/QList>
33 #include <QtCore/QHash>
34 #include <QtCore/QVariant>
36 namespace KPIMIdentities
45 namespace KPIMIdentities
48 static const char s_uoid[] =
"uoid";
49 static const char s_identity[] =
"Identity";
50 static const char s_name[] =
"Name";
51 static const char s_organization[] =
"Organization";
52 static const char s_pgps[] =
"PGP Signing Key";
53 static const char s_pgpe[] =
"PGP Encryption Key";
54 static const char s_smimes[] =
"SMIME Signing Key";
55 static const char s_smimee[] =
"SMIME Encryption Key";
56 static const char s_prefcrypt[] =
"Preferred Crypto Message Format";
57 static const char s_email[] =
"Email Address";
58 static const char s_replyto[] =
"Reply-To Address";
59 static const char s_bcc[] =
"Bcc";
60 static const char s_cc[] =
"Cc";
61 static const char s_vcard[] =
"VCardFile";
62 static const char s_transport[] =
"Transport";
63 static const char s_fcc[] =
"Fcc";
64 static const char s_drafts[] =
"Drafts";
65 static const char s_templates[] =
"Templates";
66 static const char s_dict[] =
"Dictionary";
67 static const char s_xface[] =
"X-Face";
68 static const char s_xfaceenabled[] =
"X-FaceEnabled";
69 static const char s_signature[] =
"Signature";
70 static const char s_emailAliases[] =
"Email Aliases";
71 static const char s_attachVcard[] =
"Attach Vcard";
72 static const char s_autocorrectionLanguage[] =
"Autocorrection Language";
73 static const char s_disabledFcc[] =
"Disable Fcc";
74 static const char s_pgpautosign[] =
"Pgp Auto Sign";
76 KPIMIDENTITIES_EXPORT QDataStream &
operator<<
78 KPIMIDENTITIES_EXPORT QDataStream &
operator>>
89 friend KPIMIDENTITIES_EXPORT QDataStream &
operator<<
91 friend KPIMIDENTITIES_EXPORT QDataStream &
operator>>
95 typedef QList<Identity> List;
98 explicit Identity(
const QString &
id=QString(),
99 const QString &realName=QString(),
100 const QString &emailAddr=QString(),
101 const QString &organization=QString(),
102 const QString &replyToAddress=QString() );
108 bool operator== (
const Identity &other )
const;
111 bool operator!= (
const Identity &other )
const;
114 bool operator< (
const Identity &other )
const;
117 bool operator> (
const Identity &other )
const;
120 bool operator<= (
const Identity &other )
const;
123 bool operator>= (
const Identity &other )
const;
126 bool mailingAllowed()
const;
129 QString identityName()
const;
132 void setIdentityName(
const QString &name );
135 bool isDefault()
const;
141 QString fullName()
const;
142 void setFullName(
const QString& );
145 QString organization()
const;
146 void setOrganization(
const QString& );
149 QByteArray pgpEncryptionKey()
const;
150 void setPGPEncryptionKey(
const QByteArray &key );
153 QByteArray pgpSigningKey()
const;
154 void setPGPSigningKey(
const QByteArray &key );
157 QByteArray smimeEncryptionKey()
const;
158 void setSMIMEEncryptionKey(
const QByteArray &key );
161 QByteArray smimeSigningKey()
const;
162 void setSMIMESigningKey(
const QByteArray &key );
164 QString preferredCryptoMessageFormat()
const;
165 void setPreferredCryptoMessageFormat(
const QString& );
173 KPIMIDENTITIES_DEPRECATED QString emailAddr()
const;
174 KPIMIDENTITIES_DEPRECATED
void setEmailAddr(
const QString& );
182 QString primaryEmailAddress()
const;
183 void setPrimaryEmailAddress(
const QString & email );
190 const QStringList emailAliases()
const;
191 void setEmailAliases(
const QStringList & aliases );
200 bool matchesEmailAddress(
const QString & addr )
const;
203 QString vCardFile()
const;
204 void setVCardFile(
const QString& );
208 QString fullEmailAddr()
const;
211 QString replyToAddr()
const;
212 void setReplyToAddr(
const QString& );
216 void setBcc(
const QString& );
222 void setCc(
const QString& );
228 bool attachVcard()
const;
229 void setAttachVcard(
bool attach);
234 QString autocorrectionLanguage()
const;
235 void setAutocorrectionLanguage(
const QString& language);
240 bool disabledFcc()
const;
241 void setDisabledFcc(
bool);
246 bool pgpAutoSign()
const;
247 void setPgpAutoSign(
bool);
250 void setSignature(
const Signature &sig );
260 QString signatureText(
bool *ok = 0 )
const;
266 bool signatureIsInlinedHtml()
const;
270 QString transport()
const;
271 void setTransport(
const QString& );
276 void setFcc(
const QString& );
282 QString drafts()
const;
283 void setDrafts(
const QString& );
289 QString templates()
const;
290 void setTemplates(
const QString& );
298 QString dictionary()
const;
299 void setDictionary(
const QString& );
302 QString xface()
const;
303 void setXFace(
const QString& );
304 bool isXFaceEnabled()
const;
305 void setXFaceEnabled(
const bool );
310 QVariant property(
const QString &key )
const;
313 void setProperty(
const QString &key,
const QVariant &value );
320 static QString mimeDataType();
321 static bool canDecode(
const QMimeData* );
322 void populateMimeData( QMimeData* );
323 static Identity fromMimeData(
const QMimeData* );
327 void readConfig(
const KConfigGroup & );
331 void writeConfig( KConfigGroup & )
const;
341 void setIsDefault(
bool flag );
346 void setUoid( uint aUoid );
351 QString verifyAkonadiId(
const QString& str)
const;
354 bool signatureIsCommand()
const;
357 bool signatureIsPlainFile()
const;
360 bool signatureIsInline()
const;
363 QString signatureFile()
const;
364 void setSignatureFile(
const QString& );
367 QString signatureInlineText()
const;
368 void setSignatureInlineText(
const QString& );
371 bool useSignatureFile()
const;
375 QHash<QString, QVariant> mPropertiesMap;
Manages the list of identities.
Abstraction of a signature (aka "footer").
User identity information.