22#ifndef KPIMIDENTITES_IDENTITY_H
23#define KPIMIDENTITES_IDENTITY_H
25#include "kpimidentities_export.h"
30#include <QtCore/QString>
31#include <QtCore/QStringList>
32#include <QtCore/QList>
33#include <QtCore/QHash>
34#include <QtCore/QVariant>
36namespace KPIMIdentities
45namespace 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";
75 static const char s_defaultDomainName[] =
"Default Domain";
77 KPIMIDENTITIES_EXPORT QDataStream &
operator<<
78 ( QDataStream &stream,
const KPIMIdentities::Identity &ident );
79 KPIMIDENTITIES_EXPORT QDataStream &
operator>>
80 ( QDataStream &stream, KPIMIdentities::Identity &ident );
88 friend class IdentityManager;
90 friend KPIMIDENTITIES_EXPORT QDataStream &
operator<<
92 friend KPIMIDENTITIES_EXPORT QDataStream &
operator>>
96 typedef QList<Identity> List;
99 explicit Identity(
const QString &
id=QString(),
100 const QString &realName=QString(),
103 const QString &replyToAddress=QString() );
109 bool operator== (
const Identity &other )
const;
112 bool operator!= (
const Identity &other )
const;
115 bool operator< (
const Identity &other )
const;
118 bool operator> (
const Identity &other )
const;
121 bool operator<= (
const Identity &other )
const;
124 bool operator>= (
const Identity &other )
const;
143 void setFullName(
const QString& );
147 void setOrganization(
const QString& );
151 void setPGPEncryptionKey(
const QByteArray &key );
155 void setPGPSigningKey(
const QByteArray &key );
159 void setSMIMEEncryptionKey(
const QByteArray &key );
163 void setSMIMESigningKey(
const QByteArray &key );
165 QString preferredCryptoMessageFormat()
const;
166 void setPreferredCryptoMessageFormat(
const QString& );
174 KPIMIDENTITIES_DEPRECATED QString
emailAddr()
const;
175 KPIMIDENTITIES_DEPRECATED
void setEmailAddr(
const QString& );
184 void setPrimaryEmailAddress(
const QString & email );
192 void setEmailAliases(
const QStringList & aliases );
205 void setVCardFile(
const QString& );
213 void setReplyToAddr(
const QString& );
217 void setBcc(
const QString& );
223 void setCc(
const QString& );
230 void setAttachVcard(
bool attach);
236 void setAutocorrectionLanguage(
const QString& language);
242 void setDisabledFcc(
bool);
248 void setPgpAutoSign(
bool);
254 void setDefaultDomainName(
const QString &domainName);
257 void setSignature(
const Signature &sig );
278 void setTransport(
const QString& );
283 void setFcc(
const QString& );
290 void setDrafts(
const QString& );
297 void setTemplates(
const QString& );
306 void setDictionary(
const QString& );
309 QString
xface()
const;
310 void setXFace(
const QString& );
311 bool isXFaceEnabled()
const;
312 void setXFaceEnabled(
const bool );
317 QVariant
property(
const QString &key )
const;
320 void setProperty(
const QString &key,
const QVariant &value );
327 static QString mimeDataType();
328 static bool canDecode(
const QMimeData* );
329 void populateMimeData( QMimeData* );
330 static Identity fromMimeData(
const QMimeData* );
371 void setSignatureFile(
const QString& );
375 void setSignatureInlineText(
const QString& );
382 QHash<QString, QVariant> mPropertiesMap;
User identity information.
QString primaryEmailAddress() const
primary email address (without the user name - only name@host).
QString signatureText(bool *ok=0) const
QString fullName() const
Full name of the user.
QString defaultDomainName() const
bool signatureIsPlainFile() const
QString templates() const
The folder where template messages from this identity will be stored by default.
bool signatureIsCommand() const
bool matchesEmailAddress(const QString &addr) const
const QStringList emailAliases() const
email address aliases
void setUoid(uint aUoid)
set the uiod
QString signatureFile() const
name of the signature file (with path)
bool mailingAllowed() const
Tests if there are enough values set to allow mailing.
QString fcc() const
The folder where sent messages from this identity will be stored by default.
void setIsDefault(bool flag)
Set whether this identity is the default identity.
QVariant property(const QString &key) const
Get random properties.
QString drafts() const
The folder where draft messages from this identity will be stored by default.
QString signatureInlineText() const
inline signature
QByteArray smimeSigningKey() const
The user's S/MIME signing key.
bool isNull() const
Returns true when the identity contains no values, all null values or only empty values.
QByteArray pgpSigningKey() const
The user's OpenPGP signing key.
QString identityName() const
Identity/nickname for this collection.
void writeConfig(KConfigGroup &) const
Write configuration to config.
void setProperty(const QString &key, const QVariant &value)
Set random properties, when value is empty (for QStrings) or null, the property is deleted.
QString autocorrectionLanguage() const
void readConfig(const KConfigGroup &)
Read configuration from config.
QString dictionary() const
Dictionary which should be used for spell checking.
Identity(const QString &id=QString(), const QString &realName=QString(), const QString &emailAddr=QString(), const QString &organization=QString(), const QString &replyToAddress=QString())
Constructor.
QString organization() const
The user's organization (optional)
QString fullEmailAddr() const
email address in the format "username <name@host>" suitable for the "From:" field of email messages.
bool useSignatureFile() const
Inline or signature from a file.
QString cc() const
email addresses for the CC: field
QString bcc() const
email addresses for the BCC: field
bool signatureIsInlinedHtml() const
QString transport() const
The transport that is set for this identity.
QString replyToAddr() const
email address for the ReplyTo: field
KPIMIDENTITIES_DEPRECATED QString emailAddr() const
email address (without the user name - only name@host)
bool signatureIsInline() const
QByteArray smimeEncryptionKey() const
The user's S/MIME encryption key.
void setIdentityName(const QString &name)
Identity/nickname for this collection.
QString verifyAkonadiId(const QString &str) const
during migration when it failed it can be a string => not a qlonglong akonadi::id => fix it
uint uoid() const
Unique Object Identifier for this identity.
QString vCardFile() const
vCard to attach to outgoing emails
QByteArray pgpEncryptionKey() const
The user's OpenPGP encryption key.
QString xface() const
a X-Face header for this identity
Abstraction of a signature (aka "footer").