CollectionFetchJob Class Reference
from PyKDE4.akonadi import *
Inherits: Akonadi.Job → KCompositeJob → KJob → QObject
Namespace: Akonadi.CollectionFetchJob
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 containing emails recursively, starting at the root collection CollectionFetchJob *job = new CollectionFetchJob( Collection.root(), CollectionFetchJob.Recursive, this ); job->fetchScope().setContentMimeTypes( QStringList() << "message/rfc822" ); connect( job, SIGNAL(collectionsReceived(Akonadi.Collection.List)), this, SLOT(myCollectionsReceived(Akonadi.Collection.List)) ); connect( job, SIGNAL(result(KJob*)), this, SLOT(collectionFetchResult(KJob*)) );
Enumerations | |
Type | { Base, FirstLevel, Recursive } |
Signals | |
collectionsReceived (Akonadi.Collection.List collections) | |
Methods | |
__init__ (self, Akonadi.Collection collection, Akonadi.CollectionFetchJob.Type type=Akonadi.CollectionFetchJob.FirstLevel, QObject parent=0) | |
__init__ (self, Akonadi.Collection.List collections, QObject parent=0) | |
Akonadi.Collection.List | collections (self) |
collectionsReceived (self, Akonadi.Collection.List collections) | |
doHandleResponse (self, QByteArray tag, QByteArray data) | |
doStart (self) | |
Akonadi.CollectionFetchScope | fetchScope (self) |
includeStatistics (self, bool include=1) | |
includeUnsubscribed (self, bool include=1) | |
setFetchScope (self, Akonadi.CollectionFetchScope fetchScope) | |
setResource (self, QString resource) | |
slotResult (self, KJob job) |
Method Documentation
__init__ | ( | self, | ||
Akonadi.Collection | collection, | |||
Akonadi.CollectionFetchJob.Type | type=Akonadi.CollectionFetchJob.FirstLevel, | |||
QObject | parent=0 | |||
) |
__init__ | ( | self, | ||
Akonadi.Collection.List | collections, | |||
QObject | parent=0 | |||
) |
Akonadi.Collection.List collections | ( | self ) |
Returns the list of fetched collection.
collectionsReceived | ( | self, | ||
Akonadi.Collection.List | collections | |||
) |
This signal is emitted whenever the job has received collections.
- Parameters:
-
collections The received collections.
- Signal syntax:
QObject.connect(source, SIGNAL("collectionsReceived(const const Akonadi::Collection::List&)"), target_slot)
doHandleResponse | ( | self, | ||
QByteArray | tag, | |||
QByteArray | data | |||
) |
doStart | ( | self ) |
Akonadi.CollectionFetchScope fetchScope | ( | self ) |
Returns the collection fetch scope.
Since this returns a reference it can be used to conveniently modify the current scope in-place, i.e. by calling a method on the returned reference without storing it in a local variable. See the CollectionFetchScope documentation for an example.
- Returns:
- a reference to the current collection fetch scope
- See also:
- setFetchScope() for replacing the current collection fetch scope
- Since:
- 4.4
includeStatistics | ( | self, | ||
bool | include=1 | |||
) |
Include also statistics about the collections.
- Since:
- 4.3
- Deprecated:
- Use CollectionFetchScope instead.
includeUnsubscribed | ( | self, | ||
bool | include=1 | |||
) |
Include also unsubscribed collections.
- Deprecated:
- Use CollectionFetchScope instead.
setFetchScope | ( | self, | ||
Akonadi.CollectionFetchScope | fetchScope | |||
) |
Sets the collection fetch scope.
The CollectionFetchScope controls how much of a collection's data is fetched from the server as well as filter to select which collections to fetch.
- Parameters:
-
fetchScope The new scope for collection fetch operations.
- See also:
- fetchScope()
- Since:
- 4.4
setResource | ( | self, | ||
QString | resource | |||
) |
Sets a resource identifier to limit collection listing to one resource.
- Parameters:
-
resource The resource identifier.
- Deprecated:
- Use CollectionFetchScope instead.
slotResult | ( | self, | ||
KJob | job | |||
) |
Enumeration Documentation
Type |
- Enumerator:
-