• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.11.3 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 
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 
75  KPIMIDENTITIES_EXPORT QDataStream &operator<<
76  ( QDataStream &stream, const KPIMIdentities::Identity &ident );
77  KPIMIDENTITIES_EXPORT QDataStream &operator>>
78  ( QDataStream &stream, KPIMIdentities::Identity &ident );
79 
81 class KPIMIDENTITIES_EXPORT Identity
82 {
83  // only the identity manager should be able to construct and
84  // destruct us, but then we get into problems with using
85  // QValueList<Identity> and especially qHeapSort().
86  friend class IdentityManager;
87 
88  friend KPIMIDENTITIES_EXPORT QDataStream &operator<<
89  ( QDataStream &stream, const KPIMIdentities::Identity &ident );
90  friend KPIMIDENTITIES_EXPORT QDataStream &operator>>
91  ( QDataStream &stream, KPIMIdentities::Identity &ident );
92 
93  public:
94  typedef QList<Identity> List;
95 
97  explicit Identity( const QString &id=QString(),
98  const QString &realName=QString(),
99  const QString &emailAddr=QString(),
100  const QString &organization=QString(),
101  const QString &replyToAddress=QString() );
102 
104  ~Identity();
105 
107  bool operator== ( const Identity &other ) const;
108 
110  bool operator!= ( const Identity &other ) const;
111 
113  bool operator< ( const Identity &other ) const;
114 
116  bool operator> ( const Identity &other ) const;
117 
119  bool operator<= ( const Identity &other ) const;
120 
122  bool operator>= ( const Identity &other ) const;
123 
125  bool mailingAllowed() const;
126 
128  QString identityName() const;
129 
131  void setIdentityName( const QString &name );
132 
134  bool isDefault() const;
135 
137  uint uoid() const;
138 
140  QString fullName() const;
141  void setFullName( const QString& );
142 
144  QString organization() const;
145  void setOrganization( const QString& );
146 
148  QByteArray pgpEncryptionKey() const;
149  void setPGPEncryptionKey( const QByteArray &key );
150 
152  QByteArray pgpSigningKey() const;
153  void setPGPSigningKey( const QByteArray &key );
154 
156  QByteArray smimeEncryptionKey() const;
157  void setSMIMEEncryptionKey( const QByteArray &key );
158 
160  QByteArray smimeSigningKey() const;
161  void setSMIMESigningKey( const QByteArray &key );
162 
163  QString preferredCryptoMessageFormat() const;
164  void setPreferredCryptoMessageFormat( const QString& );
165 
172  KDE_DEPRECATED QString emailAddr() const;
173  KDE_DEPRECATED void setEmailAddr( const QString& );
174 
181  QString primaryEmailAddress() const;
182  void setPrimaryEmailAddress( const QString & email );
183 
189  const QStringList emailAliases() const;
190  void setEmailAliases( const QStringList & aliases );
191 
199  bool matchesEmailAddress( const QString & addr ) const;
200 
202  QString vCardFile() const;
203  void setVCardFile( const QString& );
204 
207  QString fullEmailAddr() const;
208 
210  QString replyToAddr() const;
211  void setReplyToAddr( const QString& );
212 
214  QString bcc() const;
215  void setBcc( const QString& );
216 
220  QString cc() const;
221  void setCc( const QString& );
222 
227  bool attachVcard() const;
228  void setAttachVcard(bool attach);
229 
233  QString autocorrectionLanguage() const;
234  void setAutocorrectionLanguage(const QString& language);
235 
239  bool disabledFcc() const;
240  void setDisabledFcc(bool);
241 
242  void setSignature( const Signature &sig );
243  Signature &signature(); /* _not_ const! */
244 
252  QString signatureText( bool *ok = 0 ) const;
253 
258  bool signatureIsInlinedHtml() const;
259 
262  QString transport() const;
263  void setTransport( const QString& );
264 
267  QString fcc() const;
268  void setFcc( const QString& );
269 
274  QString drafts() const;
275  void setDrafts( const QString& );
276 
281  QString templates() const;
282  void setTemplates( const QString& );
283 
290  QString dictionary() const;
291  void setDictionary( const QString& );
292 
294  QString xface() const;
295  void setXFace( const QString& );
296  bool isXFaceEnabled() const;
297  void setXFaceEnabled( const bool );
298 
302  QVariant property( const QString &key ) const;
305  void setProperty( const QString &key, const QVariant &value );
306 
307  static const Identity &null();
310  bool isNull() const;
311 
312  static QString mimeDataType();
313  static bool canDecode( const QMimeData* );
314  void populateMimeData( QMimeData* );
315  static Identity fromMimeData( const QMimeData* );
316 
319  void readConfig( const KConfigGroup & );
320 
323  void writeConfig( KConfigGroup & ) const;
324 
333  void setIsDefault( bool flag );
334 
338  void setUoid( uint aUoid );
339 
340  protected:
343  QString verifyAkonadiId(const QString& str) const;
344 
346  bool signatureIsCommand() const;
347 
349  bool signatureIsPlainFile() const;
350 
352  bool signatureIsInline() const;
353 
355  QString signatureFile() const;
356  void setSignatureFile( const QString& );
357 
359  QString signatureInlineText() const;
360  void setSignatureInlineText( const QString& );
361 
363  bool useSignatureFile() const;
364 
365  Signature mSignature;
366  bool mIsDefault;
367  QHash<QString, QVariant> mPropertiesMap;
368 };
369 
370 }
371 
372 #endif /*kpim_identity_h*/
KPIMIdentities::IdentityManager
Manages the list of identities.
Definition: identitymanager.h:39
KPIMIdentities::Signature
Abstraction of a signature (aka &quot;footer&quot;).
Definition: signature.h:89
KPIMIdentities::Identity
User identity information.
Definition: identity.h:81
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:04:27 by doxygen 1.8.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.11.3 API Reference

Skip menu "kdepimlibs-4.11.3 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