kmail Library API Documentation

IdentityManager Class Reference

Manages the list of identities. More...

#include <identitymanager.h>

Inheritance diagram for IdentityManager:

ConfigManager List of all members.

Public Types

typedef QValueList< KMIdentity
>::Iterator 
Iterator
typedef QValueList< KMIdentity
>::ConstIterator 
ConstIterator

Signals

void changed (uint uoid)
void changed (const KMIdentity &ident)
void deleted (uint uoid)
void added (const KMIdentity &ident)

Public Member Functions

void commit ()
void rollback ()
bool hasPendingChanges () const
QStringList identities () const
QStringList shadowIdentities () const
void sort ()
const KMIdentity & identityForAddress (const QString &addresses) const
bool thatIsMe (const QString &addressList) const
const KMIdentity & identityForName (const QString &identityName) const
const KMIdentity & identityForUoid (uint uoid) const
const KMIdentity & identityForNameOrDefault (const QString &identityName) const
const KMIdentity & identityForUoidOrDefault (uint uoid) const
const KMIdentity & defaultIdentity () const
bool setAsDefault (const QString &identityName)
bool setAsDefault (uint uoid)
KMIdentity & identityForName (const QString &identityName)
KMIdentity & identityForUoid (uint uoid)
bool removeIdentity (const QString &identityName)
ConstIterator begin () const
ConstIterator end () const
Iterator begin ()
Iterator end ()
KMIdentity & newFromScratch (const QString &name)
KMIdentity & newFromControlCenter (const QString &name)
KMIdentity & newFromExisting (const KMIdentity &other, const QString &name=QString::null)

Protected Member Functions

 IdentityManager (QObject *parent=0, const char *name=0)

Protected Attributes

QValueList< KMIdentity > mIdentities
QValueList< KMIdentity > mShadowIdentities

Detailed Description

Manages the list of identities.

Author:
Marc Mutz <mutz@kde.org>

Definition at line 46 of file identitymanager.h.


Member Function Documentation

void IdentityManager::commit (   )  [virtual]
 

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

Implements ConfigManager.

Definition at line 82 of file identitymanager.cpp.

References added(), ConfigManager::changed(), deleted(), hasPendingChanges(), identityForUoid(), mIdentities, and mShadowIdentities.

void IdentityManager::rollback (   )  [virtual]
 

Re-read the config from disk and forget changes.

Implements ConfigManager.

Definition at line 124 of file identitymanager.cpp.

References mIdentities, and mShadowIdentities.

bool IdentityManager::hasPendingChanges (   )  const [virtual]
 

Check whether there are any unsaved changes.

Implements ConfigManager.

Definition at line 129 of file identitymanager.cpp.

References mIdentities, and mShadowIdentities.

Referenced by commit().

QStringList IdentityManager::identities (   )  const
 

Returns:
the list of identities

Definition at line 134 of file identitymanager.cpp.

References mIdentities.

QStringList IdentityManager::shadowIdentities (   )  const
 

Convenience method.

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

Definition at line 143 of file identitymanager.cpp.

References mShadowIdentities.

Referenced by setAsDefault().

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 155 of file identitymanager.cpp.

References mShadowIdentities.

Referenced by setAsDefault().

const KMIdentity & IdentityManager::identityForAddress (  const QString &  addresses  )  const
 

Returns:
an identity whose address matches any in addresses or KMIdentity::null if no such identity exists.

Definition at line 263 of file identitymanager.cpp.

References identityForAddress().

Referenced by identityForAddress(), and thatIsMe().

bool IdentityManager::thatIsMe (  const QString &  addressList  )  const
 

Returns:
true if addressList contains any of our addresses, false otherwise.
See also:
identityForAddress

Definition at line 280 of file identitymanager.cpp.

References identityForAddress(), KMIdentity::isNull(), and thatIsMe().

Referenced by thatIsMe().

const KMIdentity & IdentityManager::identityForName (  const QString &  identityName  )  const
 

Deprecated:
Returns:
the identity named identityName or KMIdentity::null if not found.

Definition at line 230 of file identitymanager.cpp.

References identityForName().

Referenced by identityForName(), and identityForNameOrDefault().

const KMIdentity & IdentityManager::identityForUoid (  uint  uoid  )  const
 

Returns:
the identity with Unique Object Identifier (UOID) uoid or KMIdentity::null if not found.

Definition at line 239 of file identitymanager.cpp.

References identityForUoid().

Referenced by commit(), identityForUoid(), and identityForUoidOrDefault().

const KMIdentity & IdentityManager::identityForNameOrDefault (  const QString &  identityName  )  const
 

Deprecated:
Convenience method.
Returns:
the identity named identityName or the default identity if not found.

Definition at line 245 of file identitymanager.cpp.

References defaultIdentity(), identityForName(), identityForNameOrDefault(), and KMIdentity::isNull().

Referenced by identityForNameOrDefault().

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

Convenience menthod.

Returns:
the identity with Unique Object Identifier (UOID) uoid or the default identity if not found.

Definition at line 254 of file identitymanager.cpp.

References defaultIdentity(), identityForUoid(), identityForUoidOrDefault(), and KMIdentity::isNull().

Referenced by identityForUoidOrDefault().

const KMIdentity & IdentityManager::defaultIdentity (   )  const
 

Returns:
the default identity

Definition at line 302 of file identitymanager.cpp.

References mIdentities.

Referenced by identityForNameOrDefault(), and identityForUoidOrDefault().

bool IdentityManager::setAsDefault (  const QString &  identityName  ) 
 

Deprecated:
Sets the identity named identityName to be the new default identity. As usual, use commit to make this permanent.
Returns:
false if an identity named identityName was not found

Definition at line 310 of file identitymanager.cpp.

References setAsDefault(), shadowIdentities(), and sort().

Referenced by setAsDefault().

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.

Returns:
false if an identity with UOID uoid was not found

Definition at line 322 of file identitymanager.cpp.

References mShadowIdentities, setAsDefault(), and sort().

KMIdentity & IdentityManager::identityForName (  const QString &  identityName  ) 
 

Returns:
the identity named idenityName. This method returns a reference to the identity that can be modified. To let others see this change, use commit.

Definition at line 284 of file identitymanager.cpp.

References identityForName().

KMIdentity & IdentityManager::identityForUoid (  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 293 of file identitymanager.cpp.

References identityForUoid().

bool IdentityManager::removeIdentity (  const QString &  identityName  ) 
 

Removes the identity with name identityName.

Definition at line 341 of file identitymanager.cpp.

References mShadowIdentities, and removeIdentity().

Referenced by removeIdentity().

void 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 IdentityManager::changed (  const KMIdentity &  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::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

Referenced by commit().

void IdentityManager::added (  const KMIdentity &  ident  )  [signal]
 

Emitted on commit() for each new identity.

Referenced by commit().


Member Data Documentation

QValueList<KMIdentity> IdentityManager::mIdentities [protected]
 

The list that will be seen by everyone.

Definition at line 186 of file identitymanager.h.

Referenced by commit(), defaultIdentity(), hasPendingChanges(), identities(), and rollback().

QValueList<KMIdentity> IdentityManager::mShadowIdentities [protected]
 

The list that will be seen by the config dialog.

Definition at line 188 of file identitymanager.h.

Referenced by commit(), hasPendingChanges(), removeIdentity(), rollback(), setAsDefault(), shadowIdentities(), and sort().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for kmail Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:58:04 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003