• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

kpimidentities

  • kpimidentities
identitymanager.h
1/*
2 Copyright (c) 2002 Marc Mutz <mutz@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef KPIMIDENTITIES_IDENTITYMANAGER_H
21#define KPIMIDENTITIES_IDENTITYMANAGER_H
22
23#include <kpimidentities/kpimidentities_export.h>
24#include <kconfiggroup.h>
25#include <QtCore/QObject>
26
27class KConfigBase;
28class KConfig;
29class QStringList;
30
31namespace KPIMIdentities
32{
33
34 class Identity;
39class KPIMIDENTITIES_EXPORT IdentityManager : public QObject
40{
41 Q_OBJECT
42 public:
51 explicit IdentityManager( bool readonly = false, QObject *parent=0,
52 const char *name=0 );
53 virtual ~IdentityManager();
54
55 public:
56 typedef QList<Identity>::Iterator Iterator;
57 typedef QList<Identity>::ConstIterator ConstIterator;
58
62 typedef Iterator iterator;
63
67 typedef ConstIterator const_iterator;
68
72 QString makeUnique( const QString &name ) const;
73
77 bool isUnique( const QString &name ) const;
78
80 void commit();
81
83 void rollback();
84
86 bool hasPendingChanges() const;
87
89 QStringList identities() const;
90
96 QStringList shadowIdentities() const;
97
102 void sort();
103
108 const Identity &identityForAddress( const QString &addresses ) const;
109
115 bool thatIsMe( const QString &addressList ) const;
116
121 const Identity &identityForUoid( uint uoid ) const;
122
129 const Identity &identityForUoidOrDefault( uint uoid ) const;
130
132 const Identity &defaultIdentity() const;
133
141 bool setAsDefault( uint uoid );
142
148 Identity &modifyIdentityForName( const QString &identityName );
149
154 Identity &modifyIdentityForUoid( uint uoid );
155
161 bool removeIdentity( const QString &identityName );
162
172 bool removeIdentityForced( const QString &identityName );
173
174 ConstIterator begin() const;
175 ConstIterator end() const;
178 Iterator modifyBegin();
179 Iterator modifyEnd();
180
181 Identity &newFromScratch( const QString &name );
182 Identity &newFromControlCenter( const QString &name );
183 Identity &newFromExisting( const Identity &other,
184 const QString &name=QString() );
185
188 QStringList allEmails() const;
189
190 Q_SIGNALS:
192 void changed();
197 void changed( uint uoid );
201 void changed( const KPIMIdentities::Identity &ident );
205 void deleted( uint uoid );
207 void added( const KPIMIdentities::Identity &ident );
208
209 protected:
216 virtual void createDefaultIdentity( QString&/*fullName*/,
217 QString&/*emailAddress*/ ) {}
218
219 protected Q_SLOTS:
220 void slotRollback();
221
222 protected:
224 QList<Identity> mIdentities;
226 QList<Identity> mShadowIdentities;
227
228 Q_SIGNALS:
229 void identitiesChanged( const QString &id );
230
231 private Q_SLOTS:
232 // Connected to the DBus signal
233 void slotIdentitiesChanged( const QString &id );
234
235 private:
236 void writeConfig() const;
237 void readConfig( KConfig *config );
238 QStringList groupList( KConfig *config ) const;
239 void createDefaultIdentity();
240
241 // returns a new Unique Object Identifier
242 int newUoid();
243
244 private:
245 KConfig *mConfig;
246 bool mReadOnly;
247};
248
249} // namespace
250
251#endif // _KMAIL_IDENTITYMANAGER_H_
KPIMIdentities::IdentityManager
Manages the list of identities.
Definition identitymanager.h:40
KPIMIdentities::IdentityManager::added
void added(const KPIMIdentities::Identity &ident)
Emitted on commit() for each new identity.
KPIMIdentities::IdentityManager::changed
void changed(const KPIMIdentities::Identity &ident)
Emitted whenever the identity ident changed.
KPIMIdentities::IdentityManager::mShadowIdentities
QList< Identity > mShadowIdentities
The list that will be seen by the config dialog.
Definition identitymanager.h:226
KPIMIdentities::IdentityManager::changed
void changed(uint uoid)
Emitted whenever the identity with Unique Object Identifier (UOID) uoid changed.
KPIMIdentities::IdentityManager::createDefaultIdentity
virtual void createDefaultIdentity(QString &, QString &)
This is called when no identity has been defined, so we need to create a default one.
Definition identitymanager.h:216
KPIMIdentities::IdentityManager::changed
void changed()
Emitted whenever a commit changes any configure option.
KPIMIdentities::IdentityManager::deleted
void deleted(uint uoid)
Emitted on commit() for each deleted identity.
KPIMIdentities::IdentityManager::mIdentities
QList< Identity > mIdentities
The list that will be seen by everyone.
Definition identitymanager.h:224
KPIMIdentities::Identity
User identity information.
Definition identity.h:84
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 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.14.10 API Reference

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