Akonadi::SpecialCollectionsRequestJob Class

class Akonadi::SpecialCollectionsRequestJob

A job to request SpecialCollections. More...

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

Public Functions

virtual ~SpecialCollectionsRequestJob() override
Akonadi::Collection collection() const
void requestCollection(const QByteArray &type, const Akonadi::AgentInstance &instance)
void requestDefaultCollection(const QByteArray &type)

Protected Functions

SpecialCollectionsRequestJob(Akonadi::SpecialCollections *collections, QObject *parent = nullptr)
void setDefaultResourceOptions(const QVariantMap &options)
void setDefaultResourceType(const QString &type)
void setIconForTypeMap(const QMap<QByteArray, QString> &map)
void setNameForTypeMap(const QMap<QByteArray, QString> &map)
void setTypes(const QList<QByteArray> &types)

Detailed Description

Use this job to request the SpecialCollections you need. You can request both default SpecialCollections and SpecialCollections in a given resource. The default SpecialCollections resource is created when the first default SpecialCollection is requested, but if a SpecialCollection in a custom resource is requested, this job expects that resource to exist already.

If the folders you requested already exist, this job simply succeeds. Otherwise, it creates the required collections and registers them with SpecialCollections.

This class is not meant to be used directly but as a base class for type specific special collection request jobs.

Author: Constantin Berzan <exit3219@gmail.com>

Member Function Documentation

[explicit protected] SpecialCollectionsRequestJob::SpecialCollectionsRequestJob(Akonadi::SpecialCollections *collections, QObject *parent = nullptr)

Creates a new special collections request job.

collections The SpecialCollections object that shall be used. parent The parent object.

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

Destroys the special collections request job.

Akonadi::Collection SpecialCollectionsRequestJob::collection() const

Returns the requested collection.

void SpecialCollectionsRequestJob::requestCollection(const QByteArray &type, const Akonadi::AgentInstance &instance)

Requests a special collection of the given type in the given resource instance.

void SpecialCollectionsRequestJob::requestDefaultCollection(const QByteArray &type)

Requests a special collection of the given type in the default resource.

[protected] void SpecialCollectionsRequestJob::setDefaultResourceOptions(const QVariantMap &options)

Sets the configuration options that shall be applied to the new resource that is created if the requested special collection does not exist yet.

[protected] void SpecialCollectionsRequestJob::setDefaultResourceType(const QString &type)

Sets the type of the resource that shall be created if the requested special collection does not exist yet.

[protected] void SpecialCollectionsRequestJob::setIconForTypeMap(const QMap<QByteArray, QString> &map)

Sets the map of special collection types to icon names.

[protected] void SpecialCollectionsRequestJob::setNameForTypeMap(const QMap<QByteArray, QString> &map)

Sets the map of special collection types to display names.

[protected] void SpecialCollectionsRequestJob::setTypes(const QList<QByteArray> &types)

Sets the list of well known special collection types.