• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 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 
27 class KConfigBase;
28 class KConfig;
29 class QStringList;
30 
31 namespace KPIMIdentities
32 {
33 
34  class Identity;
39 class 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 
70  QString makeUnique( const QString &name ) const;
71 
73  bool isUnique( const QString &name ) const;
74 
76  void commit();
77 
79  void rollback();
80 
82  bool hasPendingChanges() const;
83 
85  QStringList identities() const;
86 
92  QStringList shadowIdentities() const;
93 
98  void sort();
99 
103  const Identity &identityForAddress( const QString &addresses ) const;
104 
109  bool thatIsMe( const QString &addressList ) const;
110 
114  const Identity &identityForUoid( uint uoid ) const;
115 
121  const Identity &identityForUoidOrDefault( uint uoid ) const;
122 
124  const Identity &defaultIdentity() const;
125 
132  bool setAsDefault( uint uoid );
133 
138  Identity &modifyIdentityForName( const QString &identityName );
139 
144  Identity &modifyIdentityForUoid( uint uoid );
145 
150  bool removeIdentity( const QString &identityName );
151 
161  bool removeIdentityForced( const QString &identityName );
162 
163  ConstIterator begin() const;
164  ConstIterator end() const;
167  Iterator modifyBegin();
168  Iterator modifyEnd();
169 
170  Identity &newFromScratch( const QString &name );
171  Identity &newFromControlCenter( const QString &name );
172  Identity &newFromExisting( const Identity &other,
173  const QString &name=QString() );
174 
177  QStringList allEmails() const;
178 
179  Q_SIGNALS:
181  void changed();
186  void changed( uint uoid );
190  void changed( const KPIMIdentities::Identity &ident );
194  void deleted( uint uoid );
196  void added( const KPIMIdentities::Identity &ident );
197 
198  protected:
205  virtual void createDefaultIdentity( QString&/*fullName*/,
206  QString&/*emailAddress*/ ) {}
207 
208  protected Q_SLOTS:
209  void slotRollback();
210 
211  protected:
213  QList<Identity> mIdentities;
215  QList<Identity> mShadowIdentities;
216 
217  Q_SIGNALS:
218  void identitiesChanged( const QString &id );
219 
220  private Q_SLOTS:
221  // Connected to the DBus signal
222  void slotIdentitiesChanged( const QString &id );
223 
224  private:
225  void writeConfig() const;
226  void readConfig( KConfig *config );
227  QStringList groupList( KConfig *config ) const;
228  void createDefaultIdentity();
229 
230  // returns a new Unique Object Identifier
231  int newUoid();
232 
233  private:
234  KConfig *mConfig;
235  bool mReadOnly;
236 };
237 
238 } // namespace
239 
240 #endif // _KMAIL_IDENTITYMANAGER_H_
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:30:05 by doxygen 1.8.3.1 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.10.5 API Reference

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