akonadi
#include <specialmailcollections.h>

Public Types | |
enum | Type { Invalid = -1, Root = 0, Inbox, Outbox, SentMail, Trash, Drafts, Templates, LastType } |
Public Member Functions | |
Akonadi::Collection | collection (Type type, const AgentInstance &instance) const |
Akonadi::Collection | defaultCollection (Type type) const |
bool | hasCollection (Type type, const AgentInstance &instance) const |
bool | hasDefaultCollection (Type type) const |
bool | registerCollection (Type type, const Akonadi::Collection &collection) |
Static Public Member Functions | |
static SpecialMailCollections * | self () |
Detailed Description
Interface to special mail collections such as inbox, outbox etc.
This class is the central interface to the local mail folders. These folders can either be in the default resource (stored in ~/.local/share/local-mail) or in any number of custom resources. Special collections of the following types are supported: inbox, outbox, sent-mail, trash, drafts, templates and spam.
To check whether a special mail collection is available, simply use the hasCollection() and hasDefaultCollection() methods. Available special mail collections are accessible through the collection() and defaultCollection() methods.
To create a special mail collection, use a SpecialMailCollectionsRequestJob. This will create the special mail collections you request and automatically register them with SpecialMailCollections, so that it now knows they are available.
This class monitors all special mail collections known to it, and removes it from the known list if they are deleted. Note that this class does not automatically rebuild the collections that disappeared.
The defaultCollectionsChanged() and collectionsChanged() signals are emitted when the special mail collections for a resource change (i.e. some became available or some become unavailable).
if( SpecialMailCollections::self()->hasDefaultCollection( SpecialMailCollections::Outbox ) ) { const Collection col = SpecialMailCollections::self()->defaultCollection( SpecialMailCollections::Outbox ); // ... } else { // ... use SpecialMailCollectionsRequestJob to request the collection... }
- Since:
- 4.4
Member Enumeration Documentation
enum Akonadi::SpecialMailCollections::Type |
Describes the possible types of special mail collections.
Generally, there may not be two special mail collections of the same type in the same resource.
- Enumerator:
Definition at line 78 of file specialmailcollections.h.
Member Function Documentation
Akonadi::Collection Akonadi::SpecialMailCollections::collection | ( | Type | type, |
const AgentInstance & | instance | ||
) | const |
Returns the special mail collection of the given type
in the given agent instance
, or an invalid collection if such a collection is unknown.
Akonadi::Collection Akonadi::SpecialMailCollections::defaultCollection | ( | Type | type | ) | const |
Returns the special mail collection of given type
in the default resource, or an invalid collection if such a collection is unknown.
bool Akonadi::SpecialMailCollections::hasCollection | ( | Type | type, |
const AgentInstance & | instance | ||
) | const |
Returns whether the given agent instance
has a special collection of the given type
.
bool Akonadi::SpecialMailCollections::hasDefaultCollection | ( | Type | type | ) | const |
Returns whether the default resource has a special mail collection of the given type
.
bool Akonadi::SpecialMailCollections::registerCollection | ( | Type | type, |
const Akonadi::Collection & | collection | ||
) |
Registers the given collection
as a special mail collection with the given type
.
The collection must be owned by a valid resource. Registering a new collection of a previously registered type forgets the old collection.
static SpecialMailCollections* Akonadi::SpecialMailCollections::self | ( | ) | [static] |
Returns the global SpecialMailCollections instance.
The documentation for this class was generated from the following file:
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:53:15 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.