# class ItemFetchJob

###

Module | akonadi
Namespace | Akonadi
Class | ItemFetchJob
Inherits | Akonadi::Job

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() ) {
    qDebug() << "Item deleted successfully";

    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>

### methods

- ItemFetchJob (collection, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  collection | Akonadi.Collection |
  parent | QObject | 0

  Creates a new item fetch job.

  collection - The parent collection to fetch all items from.

  parent - The parent object.

- ItemFetchJob (item, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  item | Akonadi.Item |
  parent | QObject | 0

  Creates a new item fetch job.

  item - The item to fetch.

  parent - The parent object.

- doHandleResponse (tag, data)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  tag | QByteArray |
  data | QByteArray |

- doStart ( )

  returns Nothing

- fetchScope ( )

  returns Akonadi.ItemFetchScope

  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

- items ( )

  returns Akonadi.Item.List

  Returns the fetched item.

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

- itemsReceived (items)

  returns Nothing
  SIGNAL ("itemsReceived (const List&)")

  Argument | Type | Default
  --- | --- | ---
  items | Akonadi.Item.List |

  This signal is emitted when the items are fetched completely.

  items - The fetched items.

- setFetchScope (fetchScope)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  fetchScope | Akonadi.ItemFetchScope |

  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.

  fetchScope - the new scope for item fetch operations

  See also fetchScope()