Akonadi.SpecialMailCollectionsRequestJob

KDE 4.5 PyKDE API Reference

- KDE's Python API

# SpecialMailCollectionsRequestJob Class Reference

`from PyKDE4.akonadi import *`

Inherits: Akonadi.SpecialCollectionsRequestJob → Akonadi.TransactionSequence → Akonadi.Job → KCompositeJob → KJob → QObject
Namespace: Akonadi

## Detailed Description

A job to request SpecialMailCollections.

Use this job to request the SpecialMailCollections you need. You can request both default SpecialMailCollections and SpecialMailCollections in a given resource. The default SpecialMailCollections resource is created when the first default SpecialCollection is requested, but if a SpecialCollection in a custom resource is requested, this job expects that resource to exist already.

If the folders you requested already exist, this job simply succeeds. Otherwise, it creates the required collections and registers them with SpecialMailCollections.

Example:

     SpecialMailCollectionsRequestJob *job = new SpecialMailCollectionsRequestJob( this );
     job->requestDefaultCollection( SpecialMailCollections.Outbox );
     connect( job, SIGNAL( result( KJob* ) ),
              this, SLOT( requestDone( KJob* ) ) );

     ...

     MyClass.requestDone( KJob *job )
     {
       if ( job->error() )
         return;

       SpecialMailCollectionsRequestJob *requestJob = qobject_cast<SpecialMailCollectionsRequestJob*>( job );

       const Collection collection = requestJob->collection();
       ...
     }

Author:
  Constantin Berzan <exit3219@gmail.com>

Since:
  4.4

## Methods
| __init__ (self, QObject parent=0)
| requestCollection (self, Akonadi.SpecialMailCollections.Type type, Akonadi.AgentInstance instance)
| requestDefaultCollection (self, Akonadi.SpecialMailCollections.Type type)

## Method Documentation

__init__ | ( | self, |
|  | QObject | parent=0
| ) |  |  |

Creates a new special mail collections request job.

requestCollection | ( | self, |
|  | Akonadi.SpecialMailCollections.Type | type,
|  | Akonadi.AgentInstance | instance
| ) |  |  |

Requests a special mail collection of the given type in the given resource instance.

requestDefaultCollection | ( | self, |
|  | Akonadi.SpecialMailCollections.Type | type
| ) |  |  |

Requests a special mail collection of the given type in the default resource.