akonadi
Akonadi::CollectionFetchJob Class Reference
Job that fetches collections from the Akonadi storage. More...
#include <collectionfetchjob.h>

Public Types | |
Signals | |
void | collectionsReceived (const Akonadi::Collection::List &collections) |
Public Member Functions | |
CollectionFetchJob (const Collection::List &collections, QObject *parent=0) | |
CollectionFetchJob (const Collection &collection, Type type=FirstLevel, QObject *parent=0) | |
Collection::List | collections () const |
void | includeUnsubscribed (bool include=true) |
void | setResource (const QString &resource) |
virtual | ~CollectionFetchJob () |
Protected Member Functions | |
virtual void | doHandleResponse (const QByteArray &tag, const QByteArray &data) |
virtual void | doStart () |
Detailed Description
Job that fetches collections from the Akonadi storage.This class can be used to retrieve the complete or partial collection tree from the Akonadi storage.
using namespace Akonadi; // fetching all collections recursive, starting at the root collection CollectionFetchJob *job = new CollectionFetchJob( Collection::root(), CollectionFetchJob::Recursive ); if ( job->exec() ) { Collection::List collections = job->collections(); foreach( const Collection &collection, collections ) { qDebug() << "Name:" << collection.name(); } }
Definition at line 54 of file collectionfetchjob.h.
Member Enumeration Documentation
Describes the type of fetch depth.
- Enumerator:
-
Base Only fetch the base collection. FirstLevel Only list direct sub-collections of the base collection. Recursive List all sub-collections.
Definition at line 62 of file collectionfetchjob.h.
Constructor & Destructor Documentation
CollectionFetchJob::CollectionFetchJob | ( | const Collection & | collection, | |
Type | type = FirstLevel , |
|||
QObject * | parent = 0 | |||
) | [explicit] |
Creates a new collection fetch job.
- Parameters:
-
collection The base collection for the listing. Must be valid. type The type of fetch depth. parent The parent object.
Definition at line 67 of file collectionfetchjob.cpp.
CollectionFetchJob::CollectionFetchJob | ( | const Collection::List & | collections, | |
QObject * | parent = 0 | |||
) | [explicit] |
Creates a new collection fetch job to retrieve a list of collections.
- Parameters:
-
collections A list of collections to fetch. Must not be empty, content must be valid. parent The parent object.
Definition at line 83 of file collectionfetchjob.cpp.
CollectionFetchJob::~CollectionFetchJob | ( | ) | [virtual] |
Member Function Documentation
Collection::List CollectionFetchJob::collections | ( | ) | const |
void Akonadi::CollectionFetchJob::collectionsReceived | ( | const Akonadi::Collection::List & | collections | ) | [signal] |
This signal is emitted whenever the job has received collections.
- Parameters:
-
collections The received collections.
void CollectionFetchJob::doHandleResponse | ( | const QByteArray & | tag, | |
const QByteArray & | data | |||
) | [protected, virtual] |
This method should be reimplemented in the concrete jobs in case you want to handle incoming data.
It will be called on received data from the backend. The default implementation does nothing.
- Parameters:
-
tag The tag of the corresponding command, empty if this is an untagged response. data The received data.
Reimplemented from Akonadi::Job.
Definition at line 151 of file collectionfetchjob.cpp.
void CollectionFetchJob::doStart | ( | ) | [protected, virtual] |
This method must be reimplemented in the concrete jobs.
It will be called after the job has been started and a connection to the Akonadi backend has been established.
Implements Akonadi::Job.
Definition at line 109 of file collectionfetchjob.cpp.
void CollectionFetchJob::includeUnsubscribed | ( | bool | include = true |
) |
void CollectionFetchJob::setResource | ( | const QString & | resource | ) |
Sets a resource identifier to limit collection listing to one resource.
- Parameters:
-
resource The resource identifier.
Definition at line 171 of file collectionfetchjob.cpp.
The documentation for this class was generated from the following files: