• Skip to content
  • Skip to link menu
KDE 4.2 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       QString makeUnique( const QString &name ) const;
00071 
00073       bool isUnique( const QString &name ) const;
00074 
00076       void commit();
00077 
00079       void rollback();
00080 
00082       bool hasPendingChanges() const;
00083 
00085       QStringList identities() const;
00086 
00092       QStringList shadowIdentities() const;
00093 
00098       void sort();
00099 
00103       const Identity &identityForAddress( const QString &addresses ) const;
00104 
00109       bool thatIsMe( const QString &addressList ) const;
00110 
00114       const Identity &identityForUoid( uint uoid ) const;
00115 
00121       const Identity &identityForUoidOrDefault( uint uoid ) const;
00122 
00124       const Identity &defaultIdentity() const;
00125 
00132       bool setAsDefault( uint uoid );
00133 
00138       Identity &modifyIdentityForName( const QString &identityName );
00139 
00144       Identity &modifyIdentityForUoid( uint uoid );
00145 
00150       bool removeIdentity( const QString &identityName );
00151 
00152       ConstIterator begin() const;
00153       ConstIterator end() const;
00156       Iterator modifyBegin();
00157       Iterator modifyEnd();
00158 
00159       Identity &newFromScratch( const QString &name );
00160       Identity &newFromControlCenter( const QString &name );
00161       Identity &newFromExisting( const Identity &other,
00162                                   const QString &name=QString() );
00163 
00166       QStringList allEmails() const;
00167 
00168     Q_SIGNALS:
00170       void changed();
00175       void changed( uint uoid );
00179       void changed( const KPIMIdentities::Identity &ident );
00183       void deleted( uint uoid );
00185       void added( const KPIMIdentities::Identity &ident );
00186 
00187     protected:
00194       virtual void createDefaultIdentity( QString&/*fullName*/,
00195                                           QString&/*emailAddress*/ ) {}
00196 
00197     protected Q_SLOTS:
00198       void slotRollback();
00199 
00200     protected:
00202       QList<Identity> mIdentities;
00204       QList<Identity> mShadowIdentities;
00205 
00206     Q_SIGNALS:
00207       void identitiesChanged( const QString &id );
00208 
00209     private Q_SLOTS:
00210       // Connected to the DBus signal
00211       void slotIdentitiesChanged( const QString &id );
00212 
00213     private:
00214       void writeConfig() const;
00215       void readConfig( KConfig *config );
00216       QStringList groupList( KConfig *config ) const;
00217       void createDefaultIdentity();
00218 
00219       // returns a new Unique Object Identifier
00220       int newUoid();
00221 
00222     private:
00223       KConfig *mConfig;
00224       bool mReadOnly;
00225 };
00226 
00227 } // namespace
00228 
00229 #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
  •   richtextbuilders
  • 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