• Skip to content
  • Skip to link menu
KDE 4.0 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kpimidentities

identity.h

00001 /*
00002     Copyright (c) 2002-2004 Marc Mutz <mutz@kde.org>
00003     Copyright (c) 2007 Tom Albers <tomalbers@kde.nl>
00004     Author: Stefan Taferner <taferner@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or modify it
00007     under the terms of the GNU Library General Public License as published by
00008     the Free Software Foundation; either version 2 of the License, or (at your
00009     option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful, but WITHOUT
00012     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00013     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00014     License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to the
00018     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00019     02110-1301, USA.
00020 */
00021 
00022 #ifndef kpim_identity_h
00023 #define kpim_identity_h
00024 
00025 #include "kpimidentities_export.h"
00026 #include "signature.h"
00027 
00028 #include <kdemacros.h>
00029 
00030 #include <QtCore/QString>
00031 #include <QtCore/QStringList>
00032 #include <QtCore/QList>
00033 #include <QtCore/QHash>
00034 #include <QtCore/QVariant>
00035 
00036 namespace KPIMIdentities
00037 {
00038   class Identity;
00039   class Signature;
00040 }
00041 class KConfigGroup;
00042 class QDataStream;
00043 class QMimeData;
00044 
00045 namespace KPIMIdentities
00046 {
00047 
00048   static const char s_uoid[] = "uoid";
00049   static const char s_identity[] = "Identity";
00050   static const char s_name[] = "Name";
00051   static const char s_organization[] = "Organization";
00052   static const char s_pgps[] = "PGP Signing Key";
00053   static const char s_pgpe[] = "PGP Encryption Key";
00054   static const char s_smimes[] = "SMIME Signing Key";
00055   static const char s_smimee[] = "SMIME Encryption Key";
00056   static const char s_prefcrypt[] = "Preferred Crypto Message Format";
00057   static const char s_email[] = "Email Address";
00058   static const char s_replyto[] = "Reply-To Address";
00059   static const char s_bcc[] = "Bcc";
00060   static const char s_vcard[] = "VCardFile";
00061   static const char s_transport[] = "Transport";
00062   static const char s_fcc[] = "Fcc";
00063   static const char s_drafts[] = "Drafts";
00064   static const char s_templates[] = "Templates";
00065   static const char s_dict[] =  "Dictionary";
00066   static const char s_xface[] =  "X-Face";
00067   static const char s_xfaceenabled[] =  "X-FaceEnabled";
00068   static const char s_signature[] =  "Signature";
00069 
00070   KPIMIDENTITIES_EXPORT QDataStream &operator<<
00071   ( QDataStream &stream, const KPIMIdentities::Identity &ident );
00072   KPIMIDENTITIES_EXPORT QDataStream &operator>>
00073   ( QDataStream &stream, KPIMIdentities::Identity &ident );
00074 
00076   class KPIMIDENTITIES_EXPORT Identity
00077   {
00078       // only the identity manager should be able to construct and
00079       // destruct us, but then we get into problems with using
00080       // QValueList<Identity> and especially qHeapSort().
00081       friend class IdentityManager;
00082 
00083       friend KPIMIDENTITIES_EXPORT QDataStream &operator<<
00084       ( QDataStream &stream, const KPIMIdentities::Identity &ident );
00085       friend KPIMIDENTITIES_EXPORT QDataStream &operator>>
00086       ( QDataStream &stream, KPIMIdentities::Identity &ident );
00087 
00088     public:
00089       typedef QList<Identity> List;
00090 
00092       explicit Identity( const QString &id=QString(),
00093                          const QString &realName=QString(),
00094                          const QString &emailAddr=QString(),
00095                          const QString &organization=QString(),
00096                          const QString &replyToAddress=QString() );
00097 
00099       ~Identity();
00100 
00102       bool operator== ( const Identity &other ) const;
00103 
00105       bool operator!= ( const Identity &other ) const;
00106 
00108       bool operator< ( const Identity &other ) const;
00109 
00111       bool operator> ( const Identity &other ) const;
00112 
00114       bool operator<= ( const Identity &other ) const;
00115 
00117       bool operator>= ( const Identity &other ) const;
00118 
00120       bool mailingAllowed() const;
00121 
00123       QString identityName() const;
00124 
00126       void setIdentityName( const QString &name );
00127 
00129       bool isDefault() const;
00130 
00132       uint uoid() const;
00133 
00135       QString fullName() const;
00136       void setFullName( const QString& );
00137 
00139       QString organization() const;
00140       void setOrganization( const QString& );
00141 
00143       QByteArray pgpEncryptionKey() const;
00144       void setPGPEncryptionKey( const QByteArray &key );
00145 
00147       QByteArray pgpSigningKey() const;
00148       void setPGPSigningKey( const QByteArray &key );
00149 
00151       QByteArray smimeEncryptionKey() const;
00152       void setSMIMEEncryptionKey( const QByteArray &key );
00153 
00155       QByteArray smimeSigningKey() const;
00156       void setSMIMESigningKey( const QByteArray &key );
00157 
00158       QString preferredCryptoMessageFormat() const;
00159       void setPreferredCryptoMessageFormat( const QString& );
00160 
00162       QString emailAddr() const;
00163       void setEmailAddr( const QString& );
00164 
00166       QString vCardFile() const;
00167       void setVCardFile( const QString& );
00168 
00171       QString fullEmailAddr() const;
00172 
00174       QString replyToAddr() const;
00175       void setReplyToAddr( const QString& );
00176 
00178       QString bcc() const;
00179       void setBcc( const QString& );
00180 
00181       void setSignature( const Signature &sig );
00182       Signature &signature(); /* _not_ const! */
00183 
00190       QString signatureText( bool *ok = 0 ) const;
00191 
00194       QString transport() const;
00195       void setTransport( const QString& );
00196 
00199       QString fcc() const;
00200       void setFcc( const QString& );
00201 
00204       QString drafts() const;
00205       void setDrafts( const QString& );
00206 
00209       QString templates() const;
00210       void setTemplates( const QString& );
00211 
00213       QString dictionary() const;
00214       void setDictionary( const QString& );
00215 
00217       QString xface() const;
00218       void setXFace( const QString& );
00219       bool isXFaceEnabled() const;
00220       void setXFaceEnabled( const bool );
00221 
00223       QVariant property( const QString &key ) const;
00226       void setProperty( const QString &key, const QVariant &value );
00227 
00228       static const Identity &null();
00231       bool isNull() const;
00232 
00233       static QString mimeDataType();
00234       static bool canDecode( const QMimeData* );
00235       void populateMimeData( QMimeData* );
00236       static Identity fromMimeData( const QMimeData* );
00237 
00238     protected:
00241       void readConfig( const KConfigGroup & );
00242 
00245       void writeConfig( KConfigGroup & ) const;
00246 
00255       void setIsDefault( bool flag );
00256 
00258       void setUoid( uint aUoid );
00259 
00261       bool signatureIsCommand() const;
00262 
00264       bool signatureIsPlainFile() const;
00265 
00267       bool signatureIsInline() const;
00268 
00270       QString signatureFile() const;
00271       void setSignatureFile( const QString& );
00272 
00274       QString signatureInlineText() const;
00275       void setSignatureInlineText( const QString& );
00276 
00278       bool useSignatureFile() const;
00279 
00280       Signature mSignature;
00281       bool      mIsDefault;
00282       QHash<QString,QVariant>   mPropertiesMap;
00283   };
00284 
00285 }
00286 
00287 #endif /*kpim_identity_h*/

kpimidentities

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.5
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal