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

akonadi

Akonadi::ItemFetchScope

Akonadi::ItemFetchScope Class Reference

Specifies which parts of an item should be fetched from the Akonadi storage. More...

#include <itemfetchscope.h>

List of all members.


Public Member Functions

bool allAttributes () const
QSet< QByteArray > attributes () const
bool cacheOnly () const
void fetchAllAttributes (bool fetch=true)
template<typename T >
void fetchAttribute (bool fetch=true)
void fetchAttribute (const QByteArray &type, bool fetch=true)
void fetchFullPayload (bool fetch=true)
void fetchPayloadPart (const QByteArray &part, bool fetch=true)
bool fullPayload () const
bool isEmpty () const
 ItemFetchScope (const ItemFetchScope &other)
 ItemFetchScope ()
ItemFetchScope & operator= (const ItemFetchScope &other)
QSet< QByteArray > payloadParts () const
void setCacheOnly (bool cacheOnly)
 ~ItemFetchScope ()

Detailed Description

Specifies which parts of an item should be fetched from the Akonadi storage.

When items are fetched from server either by using ItemFetchJob explicitly or when it is being used internally by other classes, e.g. ItemModel, the scope of the fetch operation can be tailored to the application's current needs.

There are two supported ways of changing the currently active ItemFetchScope of classes:

  • in-place: modify the ItemFetchScope object the other class holds as a member
  • replace: replace the other class' member with a new scope object

Example: modifying an ItemFetchJob's scope in-place

 Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( collection );
 job->fetchScope().fetchFullPayload();
 job->fetchScope().fetchAttribute<MyAttribute>();

Example: replacing an ItemFetchJob's scope

 Akonadi::ItemFetchScope scope;
 scope.fetchFullPayload();
 scope.fetchAttribute<MyAttribute>();

 Akonadi::ItemFetchJob *job = new Akonadi::ItemFetchJob( collection );
 job->setFetchScope( scope );

This class is implicitly shared.

Author:
Kevin Krammer <kevin.krammer@gmx.at>

Definition at line 67 of file itemfetchscope.h.


Constructor & Destructor Documentation

ItemFetchScope::ItemFetchScope (  ) 

Creates an empty item fetch scope.

Using an empty scope will only fetch the very basic meta data of items, e.g. local id, remote id and mime type

Definition at line 28 of file itemfetchscope.cpp.

ItemFetchScope::ItemFetchScope ( const ItemFetchScope &  other  ) 

Creates a new item fetch scope from an other.

Definition at line 33 of file itemfetchscope.cpp.

ItemFetchScope::~ItemFetchScope (  ) 

Destroys the item fetch scope.

Definition at line 38 of file itemfetchscope.cpp.


Member Function Documentation

bool ItemFetchScope::allAttributes (  )  const

Returns whether all available attributes should be fetched.

See also:
fetchAllAttributes()

Definition at line 86 of file itemfetchscope.cpp.

QSet< QByteArray > ItemFetchScope::attributes (  )  const

Returns all explicitly fetched attributes.

Undefined if fetchAllAttributes() returns true.

See also:
fetchAttribute()

Definition at line 73 of file itemfetchscope.cpp.

bool ItemFetchScope::cacheOnly (  )  const

Returns whether payload data should be requested from remote sources or just from the local cache.

See also:
setCacheOnly()

Definition at line 101 of file itemfetchscope.cpp.

void ItemFetchScope::fetchAllAttributes ( bool  fetch = true  ) 

Sets whether all available attributes should be fetched.

Parameters:
fetch true if all available attributes should be fetched, false otherwise.

Definition at line 91 of file itemfetchscope.cpp.

template<typename T >
void Akonadi::ItemFetchScope::fetchAttribute ( bool  fetch = true  )  [inline]

Sets whether the attribute of the requested type should be fetched.

Parameters:
fetch true if the attribute should be fetched, false otherwise.

Definition at line 145 of file itemfetchscope.h.

void ItemFetchScope::fetchAttribute ( const QByteArray &  type,
bool  fetch = true 
)

Sets whether the attribute of the given type should be fetched.

Parameters:
type The attribute type to fetch.
fetch true if the attribute should be fetched, false otherwise.

Definition at line 78 of file itemfetchscope.cpp.

void ItemFetchScope::fetchFullPayload ( bool  fetch = true  ) 

Sets whether the full payload shall be fetched.

Parameters:
fetch true if the full payload should be fetched, false otherwise.

Definition at line 68 of file itemfetchscope.cpp.

void ItemFetchScope::fetchPayloadPart ( const QByteArray &  part,
bool  fetch = true 
)

Sets which payload parts shall be fetched.

Parameters:
part The payload part identifier. Valid values depend on the item type.
fetch true to fetch this part, false otherwise.

Definition at line 55 of file itemfetchscope.cpp.

bool ItemFetchScope::fullPayload (  )  const

Returns whether the full payload should be fetched.

See also:
fetchFullPayload()

Definition at line 63 of file itemfetchscope.cpp.

bool ItemFetchScope::isEmpty (  )  const

Returns true if there is nothing to fetch.

Definition at line 96 of file itemfetchscope.cpp.

ItemFetchScope & ItemFetchScope::operator= ( const ItemFetchScope &  other  ) 

Assigns the other to this scope and returns a reference to this scope.

Definition at line 42 of file itemfetchscope.cpp.

QSet< QByteArray > ItemFetchScope::payloadParts (  )  const

Returns the payload parts that should be fetched.

See also:
fetchPayloadPart()

Definition at line 50 of file itemfetchscope.cpp.

void ItemFetchScope::setCacheOnly ( bool  cacheOnly  ) 

Sets whether payload data should be requested from remote sources or just from the local cache.

Parameters:
cacheOnly true if no remote data should be requested, false otherwise (the default).

Definition at line 106 of file itemfetchscope.cpp.


The documentation for this class was generated from the following files:
  • itemfetchscope.h
  • itemfetchscope.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
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.7
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