• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • RecursiveItemFetchJob
Public Member Functions | List of all members
Akonadi::RecursiveItemFetchJob Class Reference

#include <recursiveitemfetchjob.h>

Inherits KJob.

Public Member Functions

 RecursiveItemFetchJob (const Akonadi::Collection &collection, const QStringList &mimeTypes, QObject *parent=0)
 
 ~RecursiveItemFetchJob ()
 
Akonadi::ItemFetchScope & fetchScope ()
 
Akonadi::Item::List items () const
 
void setFetchScope (const Akonadi::ItemFetchScope &fetchScope)
 
virtual void start ()
 

Detailed Description

Job that fetches all items of a collection recursive.

This job takes a collection as argument and returns a list of all items that are part of the passed collection and its child collections. The items to fetch can be filtered by mime types and the parts of the items that shall be fetched can be specified via an ItemFetchScope.

Example:

// Assume the following Akonadi storage tree structure:
//
// Root Collection
// |
// +- Contacts
// | |
// | +- Private
// | |
// | `- Business
// |
// `- Events
//
// Collection 'Contacts' has the ID 15, then the following code
// returns all contact items from 'Contacts', 'Private' and 'Business'.
const Akonadi::Collection contactsCollection( 15 );
const QStringList mimeTypes = QStringList() << KABC::Addressee::mimeType();
Akonadi::RecursiveItemFetchJob *job = new Akonadi::RecursiveItemFetchJob( contactsCollection, mimeTypes );
job->fetchScope().fetchFullPayload();
connect( job, SIGNAL(result(KJob*)), this, SLOT(fetchResult(KJob*)) );
job->start();
...
MyClass::fetchResult( KJob *job )
{
Akonadi::RecursiveItemFetchJob *fetchJob = qobject_cast<Akonadi::RecursiveItemFetchJob*>( job );
const Akonadi::Item::List items = fetchJob->items();
// do something with the items
}
Akonadi::Collection
Represents a collection of PIM items.
Definition: collection.h:76
Akonadi::ItemFetchScope::fetchFullPayload
void fetchFullPayload(bool fetch=true)
Sets whether the full payload shall be fetched.
Definition: itemfetchscope.cpp:70
Akonadi::RecursiveItemFetchJob
Job that fetches all items of a collection recursive.
Definition: recursiveitemfetchjob.h:85
Akonadi::RecursiveItemFetchJob::fetchScope
Akonadi::ItemFetchScope & fetchScope()
Returns the item fetch scope.
Definition: recursiveitemfetchjob.cpp:113
Akonadi::RecursiveItemFetchJob::start
virtual void start()
Starts the recursive item fetch job.
Definition: recursiveitemfetchjob.cpp:118
Akonadi::RecursiveItemFetchJob::items
Akonadi::Item::List items() const
Returns the list of fetched items.
Definition: recursiveitemfetchjob.cpp:129
Author
Tobias Koenig tokoe.nosp@m.@kde.nosp@m..org
Since
4.6

Definition at line 84 of file recursiveitemfetchjob.h.

Constructor & Destructor Documentation

◆ RecursiveItemFetchJob()

RecursiveItemFetchJob::RecursiveItemFetchJob ( const Akonadi::Collection &  collection,
const QStringList &  mimeTypes,
QObject *  parent = 0 
)
explicit

Creates a new recursive item fetch job.

Parameters
collectionThe collection that shall be fetched recursive.
mimeTypesThe list of mime types that will be used for filtering.
parentThe parent object.

Definition at line 97 of file recursiveitemfetchjob.cpp.

◆ ~RecursiveItemFetchJob()

RecursiveItemFetchJob::~RecursiveItemFetchJob ( )

Destroys the recursive item fetch job.

Definition at line 103 of file recursiveitemfetchjob.cpp.

Member Function Documentation

◆ fetchScope()

ItemFetchScope & RecursiveItemFetchJob::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 113 of file recursiveitemfetchjob.cpp.

◆ items()

Akonadi::Item::List RecursiveItemFetchJob::items ( ) const

Returns the list of fetched items.

Definition at line 129 of file recursiveitemfetchjob.cpp.

◆ setFetchScope()

void RecursiveItemFetchJob::setFetchScope ( const Akonadi::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
fetchScopeThe new scope for item fetch operations.
See also
fetchScope()

Definition at line 108 of file recursiveitemfetchjob.cpp.

◆ start()

void RecursiveItemFetchJob::start ( )
virtual

Starts the recursive item fetch job.

Definition at line 118 of file recursiveitemfetchjob.cpp.


The documentation for this class was generated from the following files:
  • recursiveitemfetchjob.h
  • recursiveitemfetchjob.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal