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

kpimidentities

identitymanager.h

00001 /*
00002     Copyright (c) 2002 Marc Mutz <mutz@kde.org>
00003 
00004     This library is free software; you can redistribute it and/or modify it
00005     under the terms of the GNU Library General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or (at your
00007     option) any later version.
00008 
00009     This library is distributed in the hope that it will be useful, but WITHOUT
00010     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00011     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library General Public
00012     License for more details.
00013 
00014     You should have received a copy of the GNU Library General Public License
00015     along with this library; see the file COPYING.LIB.  If not, write to the
00016     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
00017     02110-1301, USA.
00018 */
00019 
00020 #ifndef _KPIM_IDENTITYMANAGER_H_
00021 #define _KPIM_IDENTITYMANAGER_H_
00022 
00023 #include <kpimidentities/kpimidentities_export.h>
00024 #include <kconfiggroup.h>
00025 #include <QtCore/QObject>
00026 
00027 class KConfigBase;
00028 class KConfig;
00029 class QStringList;
00030 
00031 namespace KPIMIdentities
00032 {
00033 
00034   class Identity;
00039   class KPIMIDENTITIES_EXPORT IdentityManager : public QObject
00040   {
00041       Q_OBJECT
00042     public:
00051       explicit IdentityManager( bool readonly = false, QObject *parent=0,
00052                                 const char *name=0 );
00053       virtual ~IdentityManager();
00054 
00055     public:
00056       typedef QList<Identity>::Iterator Iterator;
00057       typedef QList<Identity>::ConstIterator ConstIterator;
00058 
00062       typedef Iterator iterator;
00063 
00067       typedef ConstIterator const_iterator;
00068 
00070       void commit();
00072       void rollback();
00073 
00075       bool hasPendingChanges() const;
00076 
00078       QStringList identities() const;
00079 
00085       QStringList shadowIdentities() const;
00086 
00091       void sort();
00092 
00096       const Identity &identityForAddress( const QString &addresses ) const;
00097 
00102       bool thatIsMe( const QString &addressList ) const;
00103 
00107       const Identity &identityForUoid( uint uoid ) const;
00108 
00114       const Identity &identityForUoidOrDefault( uint uoid ) const;
00115 
00117       const Identity &defaultIdentity() const;
00118 
00125       bool setAsDefault( uint uoid );
00126 
00131       Identity &modifyIdentityForName( const QString &identityName );
00132 
00137       Identity &modifyIdentityForUoid( uint uoid );
00138 
00143       bool removeIdentity( const QString &identityName );
00144 
00145       ConstIterator begin() const;
00146       ConstIterator end() const;
00149       Iterator modifyBegin();
00150       Iterator modifyEnd();
00151 
00152       Identity &newFromScratch( const QString &name );
00153       Identity &newFromControlCenter( const QString &name );
00154       Identity &newFromExisting( const Identity &other,
00155                                   const QString &name=QString() );
00156 
00159       QStringList allEmails() const;
00160 
00161     Q_SIGNALS:
00163       void changed();
00168       void changed( uint uoid );
00172       void changed( const KPIMIdentities::Identity &ident );
00176       void deleted( uint uoid );
00178       void added( const KPIMIdentities::Identity &ident );
00179 
00180     protected:
00187       virtual void createDefaultIdentity( QString&/*fullName*/,
00188                                           QString&/*emailAddress*/ ) {}
00189 
00190     protected Q_SLOTS:
00191       void slotRollback();
00192 
00193     protected:
00195       QList<Identity> mIdentities;
00197       QList<Identity> mShadowIdentities;
00198 
00199     Q_SIGNALS:
00200       void identitiesChanged( const QString &id );
00201 
00202     private Q_SLOTS:
00203       // Connected to the DBus signal
00204       void slotIdentitiesChanged( const QString &id );
00205 
00206     private:
00207       void writeConfig() const;
00208       void readConfig( KConfig *config );
00209       QStringList groupList( KConfig *config ) const;
00210       void createDefaultIdentity();
00211 
00212       // returns a new Unique Object Identifier
00213       int newUoid();
00214 
00215     private:
00216       KConfig *mConfig;
00217       bool mReadOnly;
00218   };
00219 
00220 } // namespace
00221 
00222 #endif // _KMAIL_IDENTITYMANAGER_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