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

kpimidentities

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
36 namespace KPIMIdentities
37 {
38  class Identity;
39  class Signature;
40 }
41 class KConfigGroup;
42 class QDataStream;
43 class QMimeData;
44 
45 namespace 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 
76  KPIMIDENTITIES_EXPORT QDataStream &operator<<
77  ( QDataStream &stream, const KPIMIdentities::Identity &ident );
78  KPIMIDENTITIES_EXPORT QDataStream &operator>>
79  ( QDataStream &stream, KPIMIdentities::Identity &ident );
80 
82 class KPIMIDENTITIES_EXPORT Identity
83 {
84  // only the identity manager should be able to construct and
85  // destruct us, but then we get into problems with using
86  // QValueList<Identity> and especially qHeapSort().
87  friend class IdentityManager;
88 
89  friend KPIMIDENTITIES_EXPORT QDataStream &operator<<
90  ( QDataStream &stream, const KPIMIdentities::Identity &ident );
91  friend KPIMIDENTITIES_EXPORT QDataStream &operator>>
92  ( QDataStream &stream, KPIMIdentities::Identity &ident );
93 
94  public:
95  typedef QList<Identity> List;
96 
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() );
103 
105  ~Identity();
106 
108  bool operator== ( const Identity &other ) const;
109 
111  bool operator!= ( const Identity &other ) const;
112 
114  bool operator< ( const Identity &other ) const;
115 
117  bool operator> ( const Identity &other ) const;
118 
120  bool operator<= ( const Identity &other ) const;
121 
123  bool operator>= ( const Identity &other ) const;
124 
126  bool mailingAllowed() const;
127 
129  QString identityName() const;
130 
132  void setIdentityName( const QString &name );
133 
135  bool isDefault() const;
136 
138  uint uoid() const;
139 
141  QString fullName() const;
142  void setFullName( const QString& );
143 
145  QString organization() const;
146  void setOrganization( const QString& );
147 
149  QByteArray pgpEncryptionKey() const;
150  void setPGPEncryptionKey( const QByteArray &key );
151 
153  QByteArray pgpSigningKey() const;
154  void setPGPSigningKey( const QByteArray &key );
155 
157  QByteArray smimeEncryptionKey() const;
158  void setSMIMEEncryptionKey( const QByteArray &key );
159 
161  QByteArray smimeSigningKey() const;
162  void setSMIMESigningKey( const QByteArray &key );
163 
164  QString preferredCryptoMessageFormat() const;
165  void setPreferredCryptoMessageFormat( const QString& );
166 
173  KPIMIDENTITIES_DEPRECATED QString emailAddr() const;
174  KPIMIDENTITIES_DEPRECATED void setEmailAddr( const QString& );
175 
182  QString primaryEmailAddress() const;
183  void setPrimaryEmailAddress( const QString & email );
184 
190  const QStringList emailAliases() const;
191  void setEmailAliases( const QStringList & aliases );
192 
200  bool matchesEmailAddress( const QString & addr ) const;
201 
203  QString vCardFile() const;
204  void setVCardFile( const QString& );
205 
208  QString fullEmailAddr() const;
209 
211  QString replyToAddr() const;
212  void setReplyToAddr( const QString& );
213 
215  QString bcc() const;
216  void setBcc( const QString& );
217 
221  QString cc() const;
222  void setCc( const QString& );
223 
228  bool attachVcard() const;
229  void setAttachVcard(bool attach);
230 
234  QString autocorrectionLanguage() const;
235  void setAutocorrectionLanguage(const QString& language);
236 
240  bool disabledFcc() const;
241  void setDisabledFcc(bool);
242 
246  bool pgpAutoSign() const;
247  void setPgpAutoSign(bool);
248 
249 
250  void setSignature( const Signature &sig );
251  Signature &signature(); /* _not_ const! */
252 
260  QString signatureText( bool *ok = 0 ) const;
261 
266  bool signatureIsInlinedHtml() const;
267 
270  QString transport() const;
271  void setTransport( const QString& );
272 
275  QString fcc() const;
276  void setFcc( const QString& );
277 
282  QString drafts() const;
283  void setDrafts( const QString& );
284 
289  QString templates() const;
290  void setTemplates( const QString& );
291 
298  QString dictionary() const;
299  void setDictionary( const QString& );
300 
302  QString xface() const;
303  void setXFace( const QString& );
304  bool isXFaceEnabled() const;
305  void setXFaceEnabled( const bool );
306 
310  QVariant property( const QString &key ) const;
313  void setProperty( const QString &key, const QVariant &value );
314 
315  static const Identity &null();
318  bool isNull() const;
319 
320  static QString mimeDataType();
321  static bool canDecode( const QMimeData* );
322  void populateMimeData( QMimeData* );
323  static Identity fromMimeData( const QMimeData* );
324 
327  void readConfig( const KConfigGroup & );
328 
331  void writeConfig( KConfigGroup & ) const;
332 
341  void setIsDefault( bool flag );
342 
346  void setUoid( uint aUoid );
347 
348  protected:
351  QString verifyAkonadiId(const QString& str) const;
352 
354  bool signatureIsCommand() const;
355 
357  bool signatureIsPlainFile() const;
358 
360  bool signatureIsInline() const;
361 
363  QString signatureFile() const;
364  void setSignatureFile( const QString& );
365 
367  QString signatureInlineText() const;
368  void setSignatureInlineText( const QString& );
369 
371  bool useSignatureFile() const;
372 
373  Signature mSignature;
374  bool mIsDefault;
375  QHash<QString, QVariant> mPropertiesMap;
376 };
377 
378 }
379 
380 #endif /*kpim_identity_h*/
KPIMIdentities::IdentityManager
Manages the list of identities.
Definition: identitymanager.h:39
KPIMIdentities::Signature
Abstraction of a signature (aka "footer").
Definition: signature.h:89
KPIMIdentities::Identity
User identity information.
Definition: identity.h:82
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:12 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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