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

kpimidentities

  • KPIMIdentities
  • IdentityManager
Public Types | Signals | Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
KPIMIdentities::IdentityManager Class Reference

#include <identitymanager.h>

Inherits QObject.

Public Types

typedef QList< Identity >
::ConstIterator 
ConstIterator
 
typedef QList< Identity >::Iterator Iterator
 

Signals

void added (const KPIMIdentities::Identity &ident)
 
void changed ()
 
void changed (uint uoid)
 
void changed (const KPIMIdentities::Identity &ident)
 
void deleted (uint uoid)
 
void identitiesChanged (const QString &id)
 

Public Member Functions

 IdentityManager (bool readonly=false, QObject *parent=0, const char *name=0)
 
QStringList allEmails () const
 
ConstIterator begin () const
 
void commit ()
 
const Identity & defaultIdentity () const
 
ConstIterator end () const
 
bool hasPendingChanges () const
 
QStringList identities () const
 
const Identity & identityForAddress (const QString &addresses) const
 
const Identity & identityForUoid (uint uoid) const
 
const Identity & identityForUoidOrDefault (uint uoid) const
 
bool isUnique (const QString &name) const
 
QString makeUnique (const QString &name) const
 
Iterator modifyBegin ()
 
Iterator modifyEnd ()
 
Identity & modifyIdentityForName (const QString &identityName)
 
Identity & modifyIdentityForUoid (uint uoid)
 
Identity & newFromControlCenter (const QString &name)
 
Identity & newFromExisting (const Identity &other, const QString &name=QString())
 
Identity & newFromScratch (const QString &name)
 
bool removeIdentity (const QString &identityName)
 
bool removeIdentityForced (const QString &identityName)
 
void rollback ()
 
bool setAsDefault (uint uoid)
 
QStringList shadowIdentities () const
 
void sort ()
 
bool thatIsMe (const QString &addressList) const
 

Protected Slots

void slotRollback ()
 

Protected Member Functions

virtual void createDefaultIdentity (QString &, QString &)
 

Protected Attributes

QList< Identity > mIdentities
 
QList< Identity > mShadowIdentities
 

Detailed Description

Manages the list of identities.

Author
Marc Mutz mutz@.nosp@m.kde..nosp@m.org

Definition at line 39 of file identitymanager.h.

Constructor & Destructor Documentation

IdentityManager::IdentityManager ( bool  readonly = false,
QObject *  parent = 0,
const char *  name = 0 
)
explicit

Create an identity manager, which loads the emailidentities file to create identities.

Parameters
readonlyif true, no changes can be made to the identity manager This means in particular that if there is no identity configured, the default identity created here will not be saved. It is assumed that a minimum of one identity is always present.

Definition at line 59 of file identitymanager.cpp.

Member Function Documentation

void KPIMIdentities::IdentityManager::added ( const KPIMIdentities::Identity &  ident)
signal

Emitted on commit() for each new identity.

QStringList KPIMIdentities::IdentityManager::allEmails ( ) const

Returns the list of all email addresses (only name) from all identities.

Definition at line 608 of file identitymanager.cpp.

void KPIMIdentities::IdentityManager::changed ( )
signal

Emitted whenever a commit changes any configure option.

void KPIMIdentities::IdentityManager::changed ( uint  uoid)
signal

Emitted whenever the identity with Unique Object Identifier (UOID) uoid changed.

Useful for more fine-grained change notifications than what is possible with the standard changed() signal.

void KPIMIdentities::IdentityManager::changed ( const KPIMIdentities::Identity &  ident)
signal

Emitted whenever the identity ident changed.

Useful for more fine-grained change notifications than what is possible with the standard changed() signal.

void IdentityManager::commit ( )

Commit changes to disk and emit changed() if necessary.

Definition at line 138 of file identitymanager.cpp.

virtual void KPIMIdentities::IdentityManager::createDefaultIdentity ( QString &  ,
QString &   
)
inlineprotectedvirtual

This is called when no identity has been defined, so we need to create a default one.

The parameters are filled with some default values from KUser, but reimplementations of this method can give them another value.

Definition at line 216 of file identitymanager.h.

const Identity & IdentityManager::defaultIdentity ( ) const
Returns
the default identity

Definition at line 398 of file identitymanager.cpp.

void KPIMIdentities::IdentityManager::deleted ( uint  uoid)
signal

Emitted on commit() for each deleted identity.

At the time this signal is emitted, the identity does still exist and can be retrieved by identityForUoid() if needed

bool IdentityManager::hasPendingChanges ( ) const

Check whether there are any unsaved changes.

Definition at line 207 of file identitymanager.cpp.

QStringList IdentityManager::identities ( ) const
Returns
the list of identities

Definition at line 212 of file identitymanager.cpp.

const Identity & IdentityManager::identityForAddress ( const QString &  addresses) const
Returns
an identity whose address matches any in addresses or Identity::null if no such identity exists.
Parameters
addressesthe string of addresses to scan for matches

Definition at line 349 of file identitymanager.cpp.

const Identity & IdentityManager::identityForUoid ( uint  uoid) const
Returns
the identity with Unique Object Identifier (UOID) uoid or Identity::null if not found.
Parameters
uoidthe Unique Object Identifier to find identity with

Definition at line 329 of file identitymanager.cpp.

const Identity & IdentityManager::identityForUoidOrDefault ( uint  uoid) const

Convenience menthod.

Returns
the identity with Unique Object Identifier (UOID) uoid or the default identity if not found.
Parameters
uoidthe Unique Object Identifier to find identity with

Definition at line 339 of file identitymanager.cpp.

bool IdentityManager::isUnique ( const QString &  name) const
Returns
whether the name is unique
Parameters
namethe name to be examined

Definition at line 133 of file identitymanager.cpp.

QString IdentityManager::makeUnique ( const QString &  name) const
Returns
a unique name for a new identity based on name
Parameters
namethe name of the base identity

Definition at line 120 of file identitymanager.cpp.

IdentityManager::Iterator IdentityManager::modifyBegin ( )

Iterator used by the configuration dialog, which works on a separate list of identities, for modification.

Changes are made effective by commit().

Definition at line 319 of file identitymanager.cpp.

Identity & IdentityManager::modifyIdentityForName ( const QString &  identityName)
Returns
the identity named identityName. This method returns a reference to the identity that can be modified. To let others see this change, use commit.
Parameters
identityNamethe identity name to return modifiable reference

Definition at line 370 of file identitymanager.cpp.

Identity & IdentityManager::modifyIdentityForUoid ( uint  uoid)
Returns
the identity with Unique Object Identifier (UOID) uoid. This method returns a reference to the identity that can be modified. To let others see this change, use commit.

Definition at line 384 of file identitymanager.cpp.

bool IdentityManager::removeIdentity ( const QString &  identityName)

Removes the identity with name identityName Will return false if the identity is not found, or when one tries to remove the last identity.

Parameters
identityNamethe identity to remove

Definition at line 440 of file identitymanager.cpp.

bool IdentityManager::removeIdentityForced ( const QString &  identityName)

Removes the identity with name identityName Will return false if the identity is not found, true otherwise.

Note
In opposite to removeIdentity, this method allows to remove the last remaining identity.
Since
4.6

Definition at line 459 of file identitymanager.cpp.

void IdentityManager::rollback ( )

Re-read the config from disk and forget changes.

Definition at line 202 of file identitymanager.cpp.

bool IdentityManager::setAsDefault ( uint  uoid)

Sets the identity with Unique Object Identifier (UOID) uoid to be new the default identity.

As usual, use commit to make this permanent.

Parameters
uoidthe default identity to set
Returns
false if an identity with UOID uoid was not found

Definition at line 414 of file identitymanager.cpp.

QStringList IdentityManager::shadowIdentities ( ) const

Convenience method.

Returns
the list of (shadow) identities, ie. the ones currently under configuration.

Definition at line 223 of file identitymanager.cpp.

void IdentityManager::sort ( )

Sort the identities by name (the default is always first).

This operates on the shadow list, so you need to commit for the changes to take effect.

Definition at line 234 of file identitymanager.cpp.

bool IdentityManager::thatIsMe ( const QString &  addressList) const
Returns
true if addressList contains any of our addresses, false otherwise.
Parameters
addressListthe addressList to examine
See also
identityForAddress

Definition at line 365 of file identitymanager.cpp.

Member Data Documentation

QList<Identity> KPIMIdentities::IdentityManager::mIdentities
protected

The list that will be seen by everyone.

Definition at line 224 of file identitymanager.h.

QList<Identity> KPIMIdentities::IdentityManager::mShadowIdentities
protected

The list that will be seen by the config dialog.

Definition at line 226 of file identitymanager.h.


The documentation for this class was generated from the following files:
  • identitymanager.h
  • identitymanager.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:01:12 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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