• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • CollectionFetchJob
Public Types | Signals | Public Member Functions | Protected Member Functions
Akonadi::CollectionFetchJob Class Reference

Job that fetches collections from the Akonadi storage. More...

#include <collectionfetchjob.h>

Inheritance diagram for Akonadi::CollectionFetchJob:
Inheritance graph
[legend]

List of all members.

Public Types

enum  Type { Base, FirstLevel, Recursive }

Signals

void collectionsReceived (const Akonadi::Collection::List &collections)

Public Member Functions

 CollectionFetchJob (const Collection &collection, Type type=FirstLevel, QObject *parent=0)
 CollectionFetchJob (const Collection::List &collections, QObject *parent=0)
virtual ~CollectionFetchJob ()
Collection::List collections () const
CollectionFetchScope & fetchScope ()
void includeStatistics (bool include=true)
void includeUnsubscribed (bool include=true)
void setFetchScope (const CollectionFetchScope &fetchScope)
void setResource (const QString &resource)

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. This fetches collection data, not item data.

 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( const Akonadi::Collection::List& ) ),
          this, SLOT( myCollectionsReceived( const Akonadi::Collection::List& ) ) );
 connect( job, SIGNAL( result( KJob* ) ), this, SLOT( collectionFetchResult( KJob* ) ) );
Author:
Volker Krause <vkrause@kde.org>

Definition at line 53 of file collectionfetchjob.h.


Member Enumeration Documentation

enum Akonadi::CollectionFetchJob::Type

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 61 of file collectionfetchjob.h.


Constructor & Destructor Documentation

Akonadi::CollectionFetchJob::CollectionFetchJob ( const Collection &  collection,
Type  type = FirstLevel,
QObject *  parent = 0 
) [explicit]

Creates a new collection fetch job.

If the given base collection has a unique identifier, this is used to identify the collection in the Akonadi server. If only a remote identifier is avaiable the collection is identified using that, provided that a resource search context has been specified. There are two ways of doing that: by calling setResource(), or globally using Akonadi::ResourceSelectJob.

Parameters:
collectionThe base collection for the listing.
typeThe type of fetch depth.
parentThe parent object.
Akonadi::CollectionFetchJob::CollectionFetchJob ( const Collection::List &  collections,
QObject *  parent = 0 
) [explicit]

Creates a new collection fetch job to retrieve a list of collections.

The same rules for identifiers apply as noted in the constructor description.

Parameters:
collectionsA list of collections to fetch. Must not be empty.
parentThe parent object.
CollectionFetchJob::~CollectionFetchJob ( ) [virtual]

Destroys the collection fetch job.

Definition at line 105 of file collectionfetchjob.cpp.


Member Function Documentation

Collection::List Akonadi::CollectionFetchJob::collections ( ) const

Returns the list of fetched collection.

void Akonadi::CollectionFetchJob::collectionsReceived ( const Akonadi::Collection::List &  collections) [signal]

This signal is emitted whenever the job has received collections.

Parameters:
collectionsThe received collections.
virtual void Akonadi::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:
tagThe tag of the corresponding command, empty if this is an untagged response.
dataThe received data.

Reimplemented from Akonadi::Job.

virtual void Akonadi::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.

CollectionFetchScope& Akonadi::CollectionFetchJob::fetchScope ( )

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
void Akonadi::CollectionFetchJob::includeStatistics ( bool  include = true)

Include also statistics about the collections.

Since:
4.3
Deprecated:
Use CollectionFetchScope instead.
void Akonadi::CollectionFetchJob::includeUnsubscribed ( bool  include = true)

Include also unsubscribed collections.

Deprecated:
Use CollectionFetchScope instead.
void Akonadi::CollectionFetchJob::setFetchScope ( const 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 a filter to select which collections to fetch.

Parameters:
fetchScopeThe new scope for collection fetch operations.
See also:
fetchScope()
Since:
4.4
void Akonadi::CollectionFetchJob::setResource ( const QString &  resource)

Sets a resource identifier to limit collection listing to one resource.

Parameters:
resourceThe resource identifier.
Deprecated:
Use CollectionFetchScope instead.

The documentation for this class was generated from the following files:
  • collectionfetchjob.h
  • collectionfetchjob.cpp

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal