# class CollectionFetchJob

###

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

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.

    using namespace Akonadi;

    // fetching all collections recursive, starting at the root collection
    CollectionFetchJob *job = new CollectionFetchJob( Collection.root(), CollectionFetchJob.Recursive );
    if ( job->exec() ) {
    Collection.List collections = job->collections();
    foreach( const Collection &collection, collections ) {
    qDebug() << "Name:" << collection.name();
    }
    }

Author Volker Krause <vkrause@kde.org>

### enums

- Type { Base, FirstLevel, Recursive }

enum details

### methods

- CollectionFetchJob (collection, type, parent)

  returns ctor

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

  Creates a new collection fetch job.

  collection - The base collection for the listing. Must be valid.

  type - The type of fetch depth.

  parent - The parent object.

- CollectionFetchJob (colletions, parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  colletions | Akonadi.Collection.List |
  parent | QObject | 0

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

  collections - A list of collections to fetch. Must not be empty, content must be valid.

  parent - The parent object.

- collections ( )

  returns Akonadi.Collection.List

  Returns the list of fetched collection.

- collectionsReceived (collections)

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

  Argument | Type | Default
  --- | --- | ---
  collections | Akonadi.Collection.List |

  This signal is emitted whenever the job has received collections.

  collections - The received collections.

- doHandleResponse (tag, data)

  returns Nothing

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

- doStart ( )

  returns Nothing

- includeUnsubscribed (include)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  include | bool | 1

  Include also unsubscribed collections.

- setResource (resource)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  resource | QString |

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

  resource - The resource identifier.

- slotResult (job)

  returns Nothing

  Argument | Type | Default
  --- | --- | ---
  job | KJob |

### enums - detail

- Type { Base, FirstLevel, Recursive }

  Describes the type of fetch depth.

  | Base | - | - |
  | FirstLevel | - | - |
  | Recursive | - | - |