• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

kpimidentities

  • kpimidentities
identity.h
1/*
2 Copyright (c) 2002-2004 Marc Mutz <mutz@kde.org>
3 Copyright (c) 2007 Tom Albers <tomalbers@kde.nl>
4 Author: Stefan Taferner <taferner@kde.org>
5
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Library General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10
11 This library is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA.
20*/
21
22#ifndef KPIMIDENTITES_IDENTITY_H
23#define KPIMIDENTITES_IDENTITY_H
24
25#include "kpimidentities_export.h"
26#include "signature.h"
27
28#include <kdemacros.h>
29
30#include <QtCore/QString>
31#include <QtCore/QStringList>
32#include <QtCore/QList>
33#include <QtCore/QHash>
34#include <QtCore/QVariant>
35
36namespace KPIMIdentities
37{
38 class Identity;
39 class Signature;
40}
41class KConfigGroup;
42class QDataStream;
43class QMimeData;
44
45namespace KPIMIdentities
46{
47
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"; // TODO: KDE5: Rename to s_primaryEmail
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";
76
77 KPIMIDENTITIES_EXPORT QDataStream &operator<<
78 ( QDataStream &stream, const KPIMIdentities::Identity &ident );
79 KPIMIDENTITIES_EXPORT QDataStream &operator>>
80 ( QDataStream &stream, KPIMIdentities::Identity &ident );
81
83class KPIMIDENTITIES_EXPORT Identity
84{
85 // only the identity manager should be able to construct and
86 // destruct us, but then we get into problems with using
87 // QValueList<Identity> and especially qHeapSort().
88 friend class IdentityManager;
89
90 friend KPIMIDENTITIES_EXPORT QDataStream &operator<<
91 ( QDataStream &stream, const KPIMIdentities::Identity &ident );
92 friend KPIMIDENTITIES_EXPORT QDataStream &operator>>
93 ( QDataStream &stream, KPIMIdentities::Identity &ident );
94
95 public:
96 typedef QList<Identity> List;
97
99 explicit Identity( const QString &id=QString(),
100 const QString &realName=QString(),
101 const QString &emailAddr=QString(),
102 const QString &organization=QString(),
103 const QString &replyToAddress=QString() );
104
106 ~Identity();
107
109 bool operator== ( const Identity &other ) const;
110
112 bool operator!= ( const Identity &other ) const;
113
115 bool operator< ( const Identity &other ) const;
116
118 bool operator> ( const Identity &other ) const;
119
121 bool operator<= ( const Identity &other ) const;
122
124 bool operator>= ( const Identity &other ) const;
125
127 bool mailingAllowed() const;
128
130 QString identityName() const;
131
133 void setIdentityName( const QString &name );
134
136 bool isDefault() const;
137
139 uint uoid() const;
140
142 QString fullName() const;
143 void setFullName( const QString& );
144
146 QString organization() const;
147 void setOrganization( const QString& );
148
150 QByteArray pgpEncryptionKey() const;
151 void setPGPEncryptionKey( const QByteArray &key );
152
154 QByteArray pgpSigningKey() const;
155 void setPGPSigningKey( const QByteArray &key );
156
158 QByteArray smimeEncryptionKey() const;
159 void setSMIMEEncryptionKey( const QByteArray &key );
160
162 QByteArray smimeSigningKey() const;
163 void setSMIMESigningKey( const QByteArray &key );
164
165 QString preferredCryptoMessageFormat() const;
166 void setPreferredCryptoMessageFormat( const QString& );
167
174 KPIMIDENTITIES_DEPRECATED QString emailAddr() const;
175 KPIMIDENTITIES_DEPRECATED void setEmailAddr( const QString& );
176
183 QString primaryEmailAddress() const;
184 void setPrimaryEmailAddress( const QString & email );
185
191 const QStringList emailAliases() const;
192 void setEmailAliases( const QStringList & aliases );
193
201 bool matchesEmailAddress( const QString & addr ) const;
202
204 QString vCardFile() const;
205 void setVCardFile( const QString& );
206
209 QString fullEmailAddr() const;
210
212 QString replyToAddr() const;
213 void setReplyToAddr( const QString& );
214
216 QString bcc() const;
217 void setBcc( const QString& );
218
222 QString cc() const;
223 void setCc( const QString& );
224
229 bool attachVcard() const;
230 void setAttachVcard(bool attach);
231
235 QString autocorrectionLanguage() const;
236 void setAutocorrectionLanguage(const QString& language);
237
241 bool disabledFcc() const;
242 void setDisabledFcc(bool);
243
247 bool pgpAutoSign() const;
248 void setPgpAutoSign(bool);
249
253 QString defaultDomainName() const;
254 void setDefaultDomainName(const QString &domainName);
255
256
257 void setSignature( const Signature &sig );
258 Signature &signature(); /* _not_ const! */
259
267 QString signatureText( bool *ok = 0 ) const;
268
273 bool signatureIsInlinedHtml() const;
274
277 QString transport() const;
278 void setTransport( const QString& );
279
282 QString fcc() const;
283 void setFcc( const QString& );
284
289 QString drafts() const;
290 void setDrafts( const QString& );
291
296 QString templates() const;
297 void setTemplates( const QString& );
298
305 QString dictionary() const;
306 void setDictionary( const QString& );
307
309 QString xface() const;
310 void setXFace( const QString& );
311 bool isXFaceEnabled() const;
312 void setXFaceEnabled( const bool );
313
317 QVariant property( const QString &key ) const;
320 void setProperty( const QString &key, const QVariant &value );
321
322 static const Identity &null();
325 bool isNull() const;
326
327 static QString mimeDataType();
328 static bool canDecode( const QMimeData* );
329 void populateMimeData( QMimeData* );
330 static Identity fromMimeData( const QMimeData* );
331
334 void readConfig( const KConfigGroup & );
335
338 void writeConfig( KConfigGroup & ) const;
339
348 void setIsDefault( bool flag );
349
353 void setUoid( uint aUoid );
354
355 protected:
358 QString verifyAkonadiId(const QString& str) const;
359
361 bool signatureIsCommand() const;
362
364 bool signatureIsPlainFile() const;
365
367 bool signatureIsInline() const;
368
370 QString signatureFile() const;
371 void setSignatureFile( const QString& );
372
374 QString signatureInlineText() const;
375 void setSignatureInlineText( const QString& );
376
378 bool useSignatureFile() const;
379
380 Signature mSignature;
381 bool mIsDefault;
382 QHash<QString, QVariant> mPropertiesMap;
383};
384
385}
386
387#endif /*kpim_identity_h*/
KPIMIdentities::IdentityManager
Manages the list of identities.
Definition: identitymanager.h:40
KPIMIdentities::Identity
User identity information.
Definition: identity.h:84
KPIMIdentities::Signature
Abstraction of a signature (aka "footer").
Definition: signature.h:90
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kpimidentities

Skip menu "kpimidentities"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal