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 KMIdentityidentityForAddress (const QString &addresses) const
bool thatIsMe (const QString &addressList) const
const KMIdentityidentityForName (const QString &identityName) const
const KMIdentityidentityForUoid (uint uoid) const
const KMIdentityidentityForNameOrDefault (const QString &identityName) const
const KMIdentityidentityForUoidOrDefault (uint uoid) const
const KMIdentitydefaultIdentity () const
bool setAsDefault (const QString &identityName)
bool setAsDefault (uint uoid)
KMIdentityidentityForName (const QString &identityName)
KMIdentityidentityForUoid (uint uoid)
bool removeIdentity (const QString &identityName)
ConstIterator begin () const
ConstIterator end () const
Iterator begin ()
Iterator end ()
KMIdentitynewFromScratch (const QString &name)
KMIdentitynewFromControlCenter (const QString &name)
KMIdentitynewFromExisting (const KMIdentity &other, const QString &name=QString::null)

Protected Member Functions

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

Protected Attributes

QValueList< KMIdentitymIdentities
QValueList< KMIdentitymShadowIdentities

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.

Referenced by 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(), and KMIdentity::isNull().

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.

Referenced by 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.

Referenced by commit(), 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(), and KMIdentity::isNull().

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(), and KMIdentity::isNull().

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 shadowIdentities(), and sort().

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, 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.

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.

bool IdentityManager::removeIdentity const QString &  identityName  ) 
 

Removes the identity with name identityName.

Definition at line 341 of file identitymanager.cpp.

References mShadowIdentities.

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.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Mar 6 17:18:23 2004 by doxygen 1.3.6-20040222 written by Dimitri van Heesch, © 1997-2003