• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 
74  KPIMIDENTITIES_EXPORT QDataStream &operator<<
75  ( QDataStream &stream, const KPIMIdentities::Identity &ident );
76  KPIMIDENTITIES_EXPORT QDataStream &operator>>
77  ( QDataStream &stream, KPIMIdentities::Identity &ident );
78 
80 class KPIMIDENTITIES_EXPORT Identity
81 {
82  // only the identity manager should be able to construct and
83  // destruct us, but then we get into problems with using
84  // QValueList<Identity> and especially qHeapSort().
85  friend class IdentityManager;
86 
87  friend KPIMIDENTITIES_EXPORT QDataStream &operator<<
88  ( QDataStream &stream, const KPIMIdentities::Identity &ident );
89  friend KPIMIDENTITIES_EXPORT QDataStream &operator>>
90  ( QDataStream &stream, KPIMIdentities::Identity &ident );
91 
92  public:
93  typedef QList<Identity> List;
94 
96  explicit Identity( const QString &id=QString(),
97  const QString &realName=QString(),
98  const QString &emailAddr=QString(),
99  const QString &organization=QString(),
100  const QString &replyToAddress=QString() );
101 
103  ~Identity();
104 
106  bool operator== ( const Identity &other ) const;
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 mailingAllowed() const;
125 
127  QString identityName() const;
128 
130  void setIdentityName( const QString &name );
131 
133  bool isDefault() const;
134 
136  uint uoid() const;
137 
139  QString fullName() const;
140  void setFullName( const QString& );
141 
143  QString organization() const;
144  void setOrganization( const QString& );
145 
147  QByteArray pgpEncryptionKey() const;
148  void setPGPEncryptionKey( const QByteArray &key );
149 
151  QByteArray pgpSigningKey() const;
152  void setPGPSigningKey( const QByteArray &key );
153 
155  QByteArray smimeEncryptionKey() const;
156  void setSMIMEEncryptionKey( const QByteArray &key );
157 
159  QByteArray smimeSigningKey() const;
160  void setSMIMESigningKey( const QByteArray &key );
161 
162  QString preferredCryptoMessageFormat() const;
163  void setPreferredCryptoMessageFormat( const QString& );
164 
171  KDE_DEPRECATED QString emailAddr() const;
172  KDE_DEPRECATED void setEmailAddr( const QString& );
173 
180  QString primaryEmailAddress() const;
181  void setPrimaryEmailAddress( const QString & email );
182 
188  const QStringList emailAliases() const;
189  void setEmailAliases( const QStringList & aliases );
190 
197  bool matchesEmailAddress( const QString & addr ) const;
198 
200  QString vCardFile() const;
201  void setVCardFile( const QString& );
202 
205  QString fullEmailAddr() const;
206 
208  QString replyToAddr() const;
209  void setReplyToAddr( const QString& );
210 
212  QString bcc() const;
213  void setBcc( const QString& );
214 
218  QString cc() const;
219  void setCc( const QString& );
220 
225  bool attachVcard() const;
226  void setAttachVcard(bool attach);
227 
231  QString autocorrectionLanguage() const;
232  void setAutocorrectionLanguage(const QString& language);
233 
234  void setSignature( const Signature &sig );
235  Signature &signature(); /* _not_ const! */
236 
243  QString signatureText( bool *ok = 0 ) const;
244 
249  bool signatureIsInlinedHtml() const;
250 
253  QString transport() const;
254  void setTransport( const QString& );
255 
258  QString fcc() const;
259  void setFcc( const QString& );
260 
265  QString drafts() const;
266  void setDrafts( const QString& );
267 
272  QString templates() const;
273  void setTemplates( const QString& );
274 
281  QString dictionary() const;
282  void setDictionary( const QString& );
283 
285  QString xface() const;
286  void setXFace( const QString& );
287  bool isXFaceEnabled() const;
288  void setXFaceEnabled( const bool );
289 
291  QVariant property( const QString &key ) const;
294  void setProperty( const QString &key, const QVariant &value );
295 
296  static const Identity &null();
299  bool isNull() const;
300 
301  static QString mimeDataType();
302  static bool canDecode( const QMimeData* );
303  void populateMimeData( QMimeData* );
304  static Identity fromMimeData( const QMimeData* );
305 
308  void readConfig( const KConfigGroup & );
309 
312  void writeConfig( KConfigGroup & ) const;
313 
322  void setIsDefault( bool flag );
323 
325  void setUoid( uint aUoid );
326 
327  protected:
330  QString verifyAkonadiId(const QString& str) const;
331 
333  bool signatureIsCommand() const;
334 
336  bool signatureIsPlainFile() const;
337 
339  bool signatureIsInline() const;
340 
342  QString signatureFile() const;
343  void setSignatureFile( const QString& );
344 
346  QString signatureInlineText() const;
347  void setSignatureInlineText( const QString& );
348 
350  bool useSignatureFile() const;
351 
352  Signature mSignature;
353  bool mIsDefault;
354  QHash<QString, QVariant> mPropertiesMap;
355 };
356 
357 }
358 
359 #endif /*kpim_identity_h*/
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:30:05 by doxygen 1.8.3.1 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.10.5 API Reference

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