Akonadi::AgentManager Class

class Akonadi::AgentManager

Provides an interface to retrieve agent types and manage agent instances. More...

Header: #include <Akonadi/AgentManager>
CMake: find_package(KPim6 REQUIRED COMPONENTS AkonadiCore)
target_link_libraries(mytarget PRIVATE KPim6::AkonadiCore)
Inherits: QObject

Public Functions

virtual ~AgentManager() override
Akonadi::AgentInstance instance(const QString &identifier) const
Akonadi::AgentInstance::List instances() const
void removeInstance(const Akonadi::AgentInstance &instance)
void synchronizeCollection(const Akonadi::Collection &collection)
void synchronizeCollection(const Akonadi::Collection &collection, bool recursive)
Akonadi::AgentType type(const QString &identifier) const
Akonadi::AgentType::List types() const

Signals

void instanceAdded(const Akonadi::AgentInstance &instance)
void instanceError(const Akonadi::AgentInstance &instance, const QString &message)
void instanceNameChanged(const Akonadi::AgentInstance &instance)
void instanceOnline(const Akonadi::AgentInstance &instance, bool online)
void instanceProgressChanged(const Akonadi::AgentInstance &instance)
void instanceRemoved(const Akonadi::AgentInstance &instance)
void instanceStatusChanged(const Akonadi::AgentInstance &instance)
void instanceWarning(const Akonadi::AgentInstance &instance, const QString &message)
void typeAdded(const Akonadi::AgentType &type)
void typeRemoved(const Akonadi::AgentType &type)

Static Public Members

Akonadi::AgentManager *self()

Detailed Description

This singleton class can be used to create or remove agent instances or trigger synchronization of collections. Furthermore it provides information about status changes of the agents.

 Akonadi::AgentManager *manager = Akonadi::AgentManager::self();

 Akonadi::AgentType::List types = manager->types();
 for ( const Akonadi::AgentType& type : types ) {
   qDebug() << "Type:" << type.name() << type.description();
 }

Author: Tobias Koenig <tokoe@kde.org>

Member Function Documentation

[override virtual noexcept] AgentManager::~AgentManager()

Destroys the agent manager.

Akonadi::AgentInstance AgentManager::instance(const QString &identifier) const

Returns the agent instance with the given identifier or an invalid agent instance if the identifier does not exist.

Note that because a resource is a special case of an agent, the identifier of a resource is the same as that of its agent instance. identifier identifier to choose the agent instance

[signal] void AgentManager::instanceAdded(const Akonadi::AgentInstance &instance)

This signal is emitted whenever a new agent instance was created.

instance The new agent instance.

[signal] void AgentManager::instanceError(const Akonadi::AgentInstance &instance, const QString &message)

This signal is emitted whenever the agent instance raised an error.

instance The agent instance that raised the error. message The i18n'ed error message.

[signal] void AgentManager::instanceNameChanged(const Akonadi::AgentInstance &instance)

This signal is emitted whenever the name of the agent instance has changed.

instance The agent instance that name has changed.

[signal] void AgentManager::instanceOnline(const Akonadi::AgentInstance &instance, bool online)

This signal is emitted whenever the online state of an agent changed.

instance The agent instance that changed its online state. online The new online state.

[signal] void AgentManager::instanceProgressChanged(const Akonadi::AgentInstance &instance)

This signal is emitted whenever the progress of an agent instance has changed.

instance The agent instance that progress has changed.

[signal] void AgentManager::instanceRemoved(const Akonadi::AgentInstance &instance)

This signal is emitted whenever an agent instance was removed.

instance The removed agent instance.

[signal] void AgentManager::instanceStatusChanged(const Akonadi::AgentInstance &instance)

This signal is emitted whenever the status of an agent instance has changed.

instance The agent instance that status has changed.

[signal] void AgentManager::instanceWarning(const Akonadi::AgentInstance &instance, const QString &message)

This signal is emitted whenever the agent instance raised a warning.

instance The agent instance that raised the warning. message The i18n'ed warning message.

Akonadi::AgentInstance::List AgentManager::instances() const

Returns the list of all available agent instances.

void AgentManager::removeInstance(const Akonadi::AgentInstance &instance)

Removes the given agent instance.

[static] Akonadi::AgentManager *AgentManager::self()

Returns the global instance of the agent manager.

void AgentManager::synchronizeCollection(const Akonadi::Collection &collection)

Trigger a synchronization of the given collection by its owning resource agent.

collection The collection to synchronize.

void AgentManager::synchronizeCollection(const Akonadi::Collection &collection, bool recursive)

Trigger a synchronization of the given collection by its owning resource agent.

collection The collection to synchronize. recursive If true, the sub-collections are also synchronized

Akonadi::AgentType AgentManager::type(const QString &identifier) const

Returns the agent type with the given identifier or an invalid agent type if the identifier does not exist.

[signal] void AgentManager::typeAdded(const Akonadi::AgentType &type)

This signal is emitted whenever a new agent type was installed on the system.

type The new agent type.

[signal] void AgentManager::typeRemoved(const Akonadi::AgentType &type)

This signal is emitted whenever an agent type was removed from the system.

type The removed agent type.

Akonadi::AgentType::List AgentManager::types() const

Returns the list of all available agent types.