• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

Akonadi::ItemFetchJob

Akonadi::ItemFetchJob Class Reference

#include <itemfetchjob.h>

Inheritance diagram for Akonadi::ItemFetchJob:

Inheritance graph
[legend]

List of all members.


Detailed Description

Job that fetches items from the Akonadi storage.

This class is used to fetch items from the Akonadi storage. Which parts of the items (e.g. headers only, attachments or all) can be specified by the ItemFetchScope.

Example:

 // Fetch all items with full payload from the root collection
 Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( Akonadi::Collection::root() );
 job->fetchScope().fetchFullPayload();

 if ( job->exec() ) {
   Akonadi::Item::List items = job->items();
   foreach( const Akonadi::Item &item, items ) {
     qDebug() "Item ID:" << item.id();
   }
 } else {
   qDebug() << "Error occurred";
 }

Author:
Volker Krause <vkrause@kde.org>

Definition at line 60 of file itemfetchjob.h.


Signals

void itemsReceived (const Akonadi::Item::List &items)

Public Member Functions

ItemFetchScope & fetchScope ()
 ItemFetchJob (const Item &item, QObject *parent=0)
 ItemFetchJob (const Collection &collection, QObject *parent=0)
Item::List items () const
void setFetchScope (ItemFetchScope &fetchScope)
virtual ~ItemFetchJob ()

Protected Member Functions

virtual void doHandleResponse (const QByteArray &tag, const QByteArray &data)
virtual void doStart ()

Constructor & Destructor Documentation

ItemFetchJob::ItemFetchJob ( const Collection &  collection,
QObject *  parent = 0 
) [explicit]

Creates a new item fetch job.

Parameters:
collection The parent collection to fetch all items from.
parent The parent object.

Definition at line 105 of file itemfetchjob.cpp.

ItemFetchJob::ItemFetchJob ( const Item &  item,
QObject *  parent = 0 
) [explicit]

Creates a new item fetch job.

Parameters:
item The item to fetch.
parent The parent object.

Definition at line 119 of file itemfetchjob.cpp.

ItemFetchJob::~ItemFetchJob (  )  [virtual]

Destroys the item fetch job.

Definition at line 134 of file itemfetchjob.cpp.


Member Function Documentation

void ItemFetchJob::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 155 of file itemfetchjob.cpp.

void ItemFetchJob::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 138 of file itemfetchjob.cpp.

ItemFetchScope & ItemFetchJob::fetchScope (  ) 

Returns the item 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 ItemFetchScope documentation for an example.

Returns:
a reference to the current item fetch scope
See also:
setFetchScope() for replacing the current item fetch scope

Definition at line 264 of file itemfetchjob.cpp.

Item::List ItemFetchJob::items (  )  const

Returns the fetched item.

Note:
The items are invalid before the result( KJob* ) signal has been emitted or if an error occurred.

Definition at line 250 of file itemfetchjob.cpp.

void Akonadi::ItemFetchJob::itemsReceived ( const Akonadi::Item::List &  items  )  [signal]

This signal is emitted when the items are fetched completely.

Parameters:
items The fetched items.

void ItemFetchJob::setFetchScope ( ItemFetchScope &  fetchScope  ) 

Sets the item fetch scope.

The ItemFetchScope controls how much of an item's data is fetched from the server, e.g. whether to fetch the full item payload or only meta data.

Parameters:
fetchScope The new scope for item fetch operations.
See also:
fetchScope()

Definition at line 257 of file itemfetchjob.cpp.


The documentation for this class was generated from the following files:
  • itemfetchjob.h
  • itemfetchjob.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
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.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