libkpimidentities
KPIM::IdentityManager Class Reference
List of all members.Detailed Description
Definition at line 54 of file identitymanager.h.
Public Types | |
typedef QValueList< Identity >::Iterator | Iterator |
typedef QValueList< Identity >::ConstIterator | ConstIterator |
Signals | |
void | changed (uint uoid) |
void | changed (const KPIM::Identity &ident) |
void | deleted (uint uoid) |
void | added (const KPIM::Identity &ident) |
DCOP Member Functions | |
void | slotIdentitiesChanged (QCString appId, QCString objId) |
Public Member Functions | |
IdentityManager (bool readonly=false, QObject *parent=0, const char *name=0) | |
virtual | ~IdentityManager () |
void | commit () |
void | rollback () |
bool | hasPendingChanges () const |
QStringList | identities () const |
QStringList | shadowIdentities () const |
void | sort () |
const Identity & | identityForAddress (const QString &addresses) const |
bool | thatIsMe (const QString &addressList) const |
const Identity & | identityForName (const QString &identityName) const |
const Identity & | identityForUoid (uint uoid) const |
const Identity & | identityForNameOrDefault (const QString &identityName) const |
const Identity & | identityForUoidOrDefault (uint uoid) const |
const Identity & | defaultIdentity () const |
bool | setAsDefault (const QString &identityName) |
bool | setAsDefault (uint uoid) |
Identity & | modifyIdentityForName (const QString &identityName) |
Identity & | modifyIdentityForUoid (uint uoid) |
bool | removeIdentity (const QString &identityName) |
ConstIterator | begin () const |
ConstIterator | end () const |
Iterator | modifyBegin () |
Iterator | modifyEnd () |
Identity & | newFromScratch (const QString &name) |
Identity & | newFromControlCenter (const QString &name) |
Identity & | newFromExisting (const Identity &other, const QString &name=QString::null) |
QStringList | allEmails () const |
Protected Slots | |
void | slotRollback () |
Protected Member Functions | |
virtual void | createDefaultIdentity (QString &, QString &) |
Protected Attributes | |
QValueList< Identity > | mIdentities |
QValueList< Identity > | mShadowIdentities |
Constructor & Destructor Documentation
IdentityManager::IdentityManager | ( | bool | readonly = false , |
|
QObject * | parent = 0 , |
|||
const char * | name = 0 | |||
) |
Create an identity manager, which loads the emailidentities file to create identities.
- Parameters:
-
readonly if 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.
Definition at line 69 of file identitymanager.cpp.
Member Function Documentation
void IdentityManager::commit | ( | ) |
Commit changes to disk and emit changed() if necessary.
Definition at line 106 of file identitymanager.cpp.
void IdentityManager::rollback | ( | ) |
Re-read the config from disk and forget changes.
Definition at line 164 of file identitymanager.cpp.
bool IdentityManager::hasPendingChanges | ( | ) | const |
QStringList IdentityManager::identities | ( | ) | const |
QStringList IdentityManager::shadowIdentities | ( | ) | const |
Convenience method.
- Returns:
- the list of (shadow) identities, ie. the ones currently under configuration.
Definition at line 183 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 192 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.
Definition at line 305 of file identitymanager.cpp.
bool IdentityManager::thatIsMe | ( | const QString & | addressList | ) | const |
- Returns:
- true if
addressList
contains any of our addresses, false otherwise.
- See also:
- identityForAddress
Definition at line 323 of file identitymanager.cpp.
const Identity & IdentityManager::identityForName | ( | const QString & | identityName | ) | const |
- Deprecated:
- Returns:
- the identity named
identityName
or Identity::null if not found.
Definition at line 272 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.
Definition at line 281 of file identitymanager.cpp.
const Identity & IdentityManager::identityForNameOrDefault | ( | const QString & | identityName | ) | const |
- Deprecated:
- Convenience method.
- Returns:
- the identity named
identityName
or the default identity if not found.
Definition at line 287 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.
Definition at line 296 of file identitymanager.cpp.
const Identity & IdentityManager::defaultIdentity | ( | ) | const |
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 353 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.
- Returns:
- false if an identity with UOID
uoid
was not found
Definition at line 365 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.
Definition at line 327 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 336 of file identitymanager.cpp.
bool IdentityManager::removeIdentity | ( | const QString & | identityName | ) |
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 264 of file identitymanager.cpp.
QStringList KPIM::IdentityManager::allEmails | ( | ) | const |
Returns the list of all email addresses (only name) from all identities.
Definition at line 498 of file identitymanager.cpp.
void KPIM::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 KPIM::IdentityManager::changed | ( | const KPIM::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 KPIM::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
void KPIM::IdentityManager::added | ( | const KPIM::Identity & | ident | ) | [signal] |
Emitted on commit() for each new identity.
virtual void KPIM::IdentityManager::createDefaultIdentity | ( | QString & | , | |
QString & | ||||
) | [inline, protected, virtual] |
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 208 of file identitymanager.h.
Member Data Documentation
QValueList<Identity> KPIM::IdentityManager::mIdentities [protected] |
QValueList<Identity> KPIM::IdentityManager::mShadowIdentities [protected] |
The documentation for this class was generated from the following files: