KIdentityManagement::IdentityManager

#include <identitymanager.h>

Inheritance diagram for KIdentityManagement::IdentityManager:

Public Types

typedef QVector< Identity >::ConstIterator ConstIterator
 
typedef QVector< Identity >::Iterator Iterator
 

Signals

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

Public Member Functions

 IdentityManager (bool readonly=false, QObject *parent=nullptr, const char *name=nullptr)
 
QStringList allEmails () const
 
ConstIterator begin () const
 
void commit ()
 
const IdentitydefaultIdentity () const
 
ConstIterator end () const
 
bool hasPendingChanges () const
 
QStringList identities () const
 
const IdentityidentityForAddress (const QString &addresses) const
 
const IdentityidentityForUoid (uint uoid) const
 
const IdentityidentityForUoidOrDefault (uint uoid) const
 
bool isUnique (const QString &name) const
 
QString makeUnique (const QString &name) const
 
Iterator modifyBegin ()
 
Iterator modifyEnd ()
 
IdentitymodifyIdentityForName (const QString &identityName)
 
IdentitymodifyIdentityForUoid (uint uoid)
 
IdentitynewFromControlCenter (const QString &name)
 
IdentitynewFromExisting (const Identity &other, const QString &name=QString())
 
IdentitynewFromScratch (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
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo ()
 
void dumpObjectInfo () const const
 
void dumpObjectTree ()
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegExp &regExp, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_DISABLE_COPY (Class)
 
 Q_DISABLE_COPY_MOVE (Class)
 
 Q_DISABLE_MOVE (Class)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qFindChild (const QObject *obj, const QString &name)
 
QList< T > qFindChildren (const QObject *obj, const QRegExp &regExp)
 
QList< T > qFindChildren (const QObject *obj, const QString &name)
 
qobject_cast (QObject *object)
 
qobject_cast (const QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds time, Qt::TimerType timerType)
 
QThreadthread () const const
 

Static Public Member Functions

static IdentityManagerself ()
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Slots

void slotRollback ()
 

Protected Member Functions

virtual void createDefaultIdentity (QString &, QString &)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Additional Inherited Members

- Properties inherited from QObject
 objectName
 
- Public Attributes inherited from QObject
typedef QObjectList
 

Detailed Description

Manages the list of identities.

Author
Marc Mutz [email protected][email protected]kde.[email protected]org

Definition at line 36 of file identitymanager.h.

Constructor & Destructor Documentation

KIdentityManagement::IdentityManager::IdentityManager ( bool  readonly = false,
QObject parent = nullptr,
const char *  name = nullptr 
)
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.

Member Function Documentation

void KIdentityManagement::IdentityManager::added ( const KIdentityManagement::Identity ident)
signal

Emitted on commit() for each new identity.

QStringList KIdentityManagement::IdentityManager::allEmails ( ) const

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

void KIdentityManagement::IdentityManager::changed ( )
signal

Emitted whenever a commit changes any configure option.

void KIdentityManagement::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 KIdentityManagement::IdentityManager::changed ( const KIdentityManagement::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 KIdentityManagement::IdentityManager::commit ( )

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

virtual void KIdentityManagement::IdentityManager::createDefaultIdentity ( QString ,
QString  
)
protectedvirtual

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.

const Identity& KIdentityManagement::IdentityManager::defaultIdentity ( ) const
Returns
the default identity
void KIdentityManagement::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 KIdentityManagement::IdentityManager::hasPendingChanges ( ) const

Check whether there are any unsaved changes.

QStringList KIdentityManagement::IdentityManager::identities ( ) const
Returns
the list of identities
const Identity& KIdentityManagement::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
const Identity& KIdentityManagement::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
const Identity& KIdentityManagement::IdentityManager::identityForUoidOrDefault ( uint  uoid) const

Convenience method.

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
bool KIdentityManagement::IdentityManager::isUnique ( const QString name) const
Returns
whether the name is unique
Parameters
namethe name to be examined
QString KIdentityManagement::IdentityManager::makeUnique ( const QString name) const
Returns
a unique name for a new identity based on name
Parameters
namethe name of the base identity
Iterator KIdentityManagement::IdentityManager::modifyBegin ( )

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

Changes are made effective by commit().

Identity& KIdentityManagement::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
Identity& KIdentityManagement::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.
bool KIdentityManagement::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
bool KIdentityManagement::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
void KIdentityManagement::IdentityManager::rollback ( )

Re-read the config from disk and forget changes.

static IdentityManager* KIdentityManagement::IdentityManager::self ( )
static

Creates or reuses the identity manager instance for this process.

It loads the emailidentities file to create identities. This sets readonly to false, so you should create a separate instance if you need it to be readonly.

Since
5.2.91
bool KIdentityManagement::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
QStringList KIdentityManagement::IdentityManager::shadowIdentities ( ) const

Convenience method.

Returns
the list of (shadow) identities, ie. the ones currently under configuration.
void KIdentityManagement::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.

bool KIdentityManagement::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

The documentation for this class was generated from the following file:
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jul 9 2020 23:10:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.