• Skip to content
  • Skip to link menu
KDE 4.6 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • KDE Home
  • Contact Us
 

akonadi/kmime

  • Akonadi
  • SpecialMailCollections
Public Types | Public Member Functions | Static Public Member Functions

Akonadi::SpecialMailCollections Class Reference

Interface to special mail collections such as inbox, outbox etc. More...

#include <specialmailcollections.h>

Inherits SpecialCollections.

List of all members.

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...
  }
Author:
Constantin Berzan <exit3219@gmail.com>
Since:
4.4

Definition at line 67 of file specialmailcollections.h.


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:
Invalid 

An invalid special collection.

Root 

The root collection containing the local folders.

Inbox 

The inbox collection.

Outbox 

The outbox collection.

SentMail 

The sent-mail collection.

Trash 

The trash collection.

Drafts 

The drafts collection.

Templates 

The templates collection.

LastType 

marker

Definition at line 78 of file specialmailcollections.h.


Member Function Documentation

Collection 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.

Definition at line 84 of file specialmailcollections.cpp.

Collection 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.

Definition at line 99 of file specialmailcollections.cpp.

bool SpecialMailCollections::hasCollection ( Type  type,
const AgentInstance &  instance 
) const

Returns whether the given agent instance has a special collection of the given type.

Definition at line 79 of file specialmailcollections.cpp.

bool SpecialMailCollections::hasDefaultCollection ( Type  type) const

Returns whether the default resource has a special mail collection of the given type.

Definition at line 94 of file specialmailcollections.cpp.

bool 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.

Definition at line 89 of file specialmailcollections.cpp.

SpecialMailCollections * SpecialMailCollections::self ( ) [static]

Returns the global SpecialMailCollections instance.

Definition at line 74 of file specialmailcollections.cpp.


The documentation for this class was generated from the following files:
  • specialmailcollections.h
  • specialmailcollections.cpp

akonadi/kmime

Skip menu "akonadi/kmime"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.3
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