• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

  • Akonadi
  • Akonadi::Collection
Public Types | Public Member Functions | Static Public Member Functions

Akonadi::Collection Class Reference

Represents a collection of PIM items. More...

#include <collection.h>

Inheritance diagram for Akonadi::Collection:
Inheritance graph
[legend]

List of all members.

Public Types

typedef QList< Collection > List
enum  Right {
  ReadOnly = 0x0, CanChangeItem = 0x1, CanCreateItem = 0x2, CanDeleteItem = 0x4,
  CanChangeCollection = 0x8, CanCreateCollection = 0x10, CanDeleteCollection = 0x20, CanLinkItem = 0x40,
  CanUnlinkItem = 0x80, AllRights
}

Public Member Functions

 Collection ()
 Collection (Id id)
 Collection (const Collection &other)
 ~Collection ()
CachePolicy cachePolicy () const
QStringList contentMimeTypes () const
QString name () const
Id parent () const
QString parentRemoteId () const
QString resource () const
Rights rights () const
void setCachePolicy (const CachePolicy &policy)
void setContentMimeTypes (const QStringList &types)
void setName (const QString &name)
void setParent (Id parent)
void setParent (const Collection &collection)
void setParentRemoteId (const QString &identifier)
void setResource (const QString &identifier)
void setRights (Rights rights)
void setStatistics (const CollectionStatistics &statistics)
CollectionStatistics statistics () const
KUrl url () const

Static Public Member Functions

static Collection fromUrl (const KUrl &url)
static QString mimeType ()
static Collection root ()

Detailed Description

Represents a collection of PIM items.

This class represents a collection of PIM items, such as a folder on a mail- or groupware-server.

Collections are hierarchical, i.e., they may have a parent collection.

 using namespace Akonadi;

 // fetching all collections recursive, starting at the root collection
 CollectionFetchJob *job = new CollectionFetchJob( Collection::root(), CollectionFetchJob::Recursive );
 connect( job, SIGNAL( result( KJob* ) ), SLOT( fetchFinished( KJob* ) ) );

 ...

 MyClass::fetchFinished( KJob *job )
 {
   if ( job->error() ) {
     qDebug() << "Error occurred";
     return;
   }

   CollectionFetchJob *fetchJob = qobject_cast<CollectionFetchJob*>( job );

   const Collection::List collections = fetchJob->collections();
   foreach ( const Collection &collection, collections ) {
     qDebug() << "Name:" << collection.name();
   }
 }
Author:
Volker Krause <vkrause@kde.org>

Definition at line 75 of file collection.h.


Member Typedef Documentation

typedef QList<Collection> Akonadi::Collection::List

Describes a list of collections.

Definition at line 81 of file collection.h.


Member Enumeration Documentation

enum Akonadi::Collection::Right

Describes rights of a collection.

Enumerator:
ReadOnly 

Can only read items or subcollection of this collection.

CanChangeItem 

Can change items in this collection.

CanCreateItem 

Can create new items in this collection.

CanDeleteItem 

Can delete items in this collection.

CanChangeCollection 

Can change this collection.

CanCreateCollection 

Can create new subcollections in this collection.

CanDeleteCollection 

Can delete this collection.

CanLinkItem 

Can create links to existing items in this virtual collection.

Since:
4.4
CanUnlinkItem 

Can remove links to items in this virtual collection.

Since:
4.4
AllRights 

Has all rights on this storage collection.

Definition at line 86 of file collection.h.


Constructor & Destructor Documentation

Akonadi::Collection::Collection (  ) 

Creates an invalid collection.

Akonadi::Collection::Collection ( Id  id  )  [explicit]

Create a new collection.

Parameters:
id The unique identifier of the collection.
Akonadi::Collection::~Collection (  ) 

Destroys the collection.

Akonadi::Collection::Collection ( const Collection &  other  ) 

Creates a collection from an other collection.


Member Function Documentation

CachePolicy Akonadi::Collection::cachePolicy (  )  const

Returns the cache policy of the collection.

QStringList Akonadi::Collection::contentMimeTypes (  )  const

Returns a list of possible content mimetypes, e.g.

message/rfc822, x-akonadi/collection for a mail folder that supports sub-folders.

static Collection Akonadi::Collection::fromUrl ( const KUrl &  url  )  [static]

Creates a collection from the given url.

static QString Akonadi::Collection::mimeType (  )  [static]

Returns the mimetype used for collections.

QString Akonadi::Collection::name (  )  const

Returns the i18n'ed name of the collection.

Id Akonadi::Collection::parent (  )  const

Returns the identifier of the parent collection.

Deprecated:
Use parentCollection()
QString Akonadi::Collection::parentRemoteId (  )  const

Returns the parent remote identifier.

Note:
This usually returns nothing for collections retrieved from the backend.
Deprecated:
Use parentCollection()
QString Akonadi::Collection::resource (  )  const

Returns the identifier of the resource owning the collection.

Rights Akonadi::Collection::rights (  )  const

Returns the rights the user has on the collection.

static Collection Akonadi::Collection::root (  )  [static]

Returns the root collection.

void Akonadi::Collection::setCachePolicy ( const CachePolicy &  policy  ) 

Sets the cache policy of the collection.

void Akonadi::Collection::setContentMimeTypes ( const QStringList &  types  ) 

Sets the list of possible content mime types.

void Akonadi::Collection::setName ( const QString &  name  ) 

Sets the i18n'ed name of the collection.

Parameters:
name The new collection name.
void Akonadi::Collection::setParent ( Id  parent  ) 

Sets the identifier of the parent collection.

Deprecated:
Use setParentCollection()
void Akonadi::Collection::setParent ( const Collection &  collection  ) 

Sets the parent collection.

Deprecated:
Use setParentCollection()
void Akonadi::Collection::setParentRemoteId ( const QString &  identifier  ) 

Sets the parent's remote identifier.

Deprecated:
Use setParentCollection()
void Akonadi::Collection::setResource ( const QString &  identifier  ) 

Sets the identifier of the resource owning the collection.

void Akonadi::Collection::setRights ( Rights  rights  ) 

Sets the rights the user has on the collection.

void Akonadi::Collection::setStatistics ( const CollectionStatistics &  statistics  ) 

Sets the collection statistics for the collection.

CollectionStatistics Akonadi::Collection::statistics (  )  const

Returns the collection statistics of the collection.

KUrl Akonadi::Collection::url (  )  const

Returns the collection url.


The documentation for this class was generated from the following file:
  • collection.h

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • 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
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • 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.1
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