• Skip to content
  • Skip to link menu
KDE 4.1 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 KPIMIDENTITIES_IDENTITYMANAGER_H
00021 #define KPIMIDENTITIES_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();
00071 
00073       void rollback();
00074 
00076       bool hasPendingChanges() const;
00077 
00079       QStringList identities() const;
00080 
00086       QStringList shadowIdentities() const;
00087 
00092       void sort();
00093 
00097       const Identity &identityForAddress( const QString &addresses ) const;
00098 
00103       bool thatIsMe( const QString &addressList ) const;
00104 
00108       const Identity &identityForUoid( uint uoid ) const;
00109 
00115       const Identity &identityForUoidOrDefault( uint uoid ) const;
00116 
00118       const Identity &defaultIdentity() const;
00119 
00126       bool setAsDefault( uint uoid );
00127 
00132       Identity &modifyIdentityForName( const QString &identityName );
00133 
00138       Identity &modifyIdentityForUoid( uint uoid );
00139 
00144       bool removeIdentity( const QString &identityName );
00145 
00146       ConstIterator begin() const;
00147       ConstIterator end() const;
00150       Iterator modifyBegin();
00151       Iterator modifyEnd();
00152 
00153       Identity &newFromScratch( const QString &name );
00154       Identity &newFromControlCenter( const QString &name );
00155       Identity &newFromExisting( const Identity &other,
00156                                   const QString &name=QString() );
00157 
00160       QStringList allEmails() const;
00161 
00162     Q_SIGNALS:
00164       void changed();
00169       void changed( uint uoid );
00173       void changed( const KPIMIdentities::Identity &ident );
00177       void deleted( uint uoid );
00179       void added( const KPIMIdentities::Identity &ident );
00180 
00181     protected:
00188       virtual void createDefaultIdentity( QString&/*fullName*/,
00189                                           QString&/*emailAddress*/ ) {}
00190 
00191     protected Q_SLOTS:
00192       void slotRollback();
00193 
00194     protected:
00196       QList<Identity> mIdentities;
00198       QList<Identity> mShadowIdentities;
00199 
00200     Q_SIGNALS:
00201       void identitiesChanged( const QString &id );
00202 
00203     private Q_SLOTS:
00204       // Connected to the DBus signal
00205       void slotIdentitiesChanged( const QString &id );
00206 
00207     private:
00208       void writeConfig() const;
00209       void readConfig( KConfig *config );
00210       QStringList groupList( KConfig *config ) const;
00211       void createDefaultIdentity();
00212 
00213       // returns a new Unique Object Identifier
00214       int newUoid();
00215 
00216     private:
00217       KConfig *mConfig;
00218       bool mReadOnly;
00219 };
00220 
00221 } // namespace
00222 
00223 #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"
  • akonadi
  • 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.7.1
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