KDE 4.3 PyKDE API Reference
  • KDE's Python API
  • Overview
  • PyKDE Home
  • Sitemap
  • Contact Us
 

Collection Class Reference

from PyKDE4.akonadi import *

Inherits: Akonadi.Entity
Namespace: Akonadi

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 );
 if ( job->exec() ) {
   Collection.List collections = job->collections();
   foreach( const Collection &collection, collections ) {
     qDebug() << "Name:" << collection.name();
   }
 }

Author:
Volker Krause <vkrause@kde.org>

See also:
akonadi_concepts_collections "Akonadi Collection Concept"


Enumerations

Right { ReadOnly, CanChangeItem, CanCreateItem, CanDeleteItem, CanChangeCollection, CanCreateCollection, CanDeleteCollection, AllRights }

Methods

 __init__ (self)
 __init__ (self, Id id)
 __init__ (self, Akonadi.Collection other)
Akonadi.CachePolicy cachePolicy (self)
QStringList contentMimeTypes (self)
QString name (self)
Id parent (self)
QString parentRemoteId (self)
QString resource (self)
Akonadi.Collection.Rights rights (self)
 setCachePolicy (self, Akonadi.CachePolicy policy)
 setContentMimeTypes (self, QStringList types)
 setName (self, QString name)
 setParent (self, Id parent)
 setParent (self, Akonadi.Collection collection)
 setParentRemoteId (self, QString identifier)
 setResource (self, QString identifier)
 setRights (self, Akonadi.Collection.Rights rights)
 setStatistics (self, Akonadi.CollectionStatistics statistics)
Akonadi.CollectionStatistics statistics (self)
KUrl url (self)

Static Methods

Akonadi.Collection fromUrl (KUrl url)
QString mimeType ()
Akonadi.Collection root ()

Method Documentation

__init__ (   self )

Creates an invalid collection.

__init__ (  self,
Id  id
)

Create a new collection.

Parameters:
id  The unique identifier of the collection.

__init__ (  self,
Akonadi.Collection  other
)

Creates a collection from an other collection.

Akonadi.CachePolicy cachePolicy (   self )

Returns the cache policy of the collection.

QStringList contentMimeTypes (   self )

Returns a list of possible content mimetypes, e.g. message/rfc822, x-akonadi/collection for a mail folder that supports sub-folders.

Akonadi.Collection fromUrl ( KUrl  url
)

Creates a collection from the given url.

QString mimeType (   )

Returns the mimetype used for collections.

QString name (   self )

Returns the i18n'ed name of the collection.

Id parent (   self )

Returns the identifier of the parent collection.

QString parentRemoteId (   self )

Returns the parent remote identifier.

Note:
This usually returns nothing for collections retrieved from the backend.

QString resource (   self )

Returns the identifier of the resource owning the collection.

Akonadi.Collection.Rights rights (   self )

Returns the rights the user has on the collection.

Akonadi.Collection root (   )

Returns the root collection.

setCachePolicy (  self,
Akonadi.CachePolicy  policy
)

Sets the cache policy of the collection.

setContentMimeTypes (  self,
QStringList  types
)

Sets the list of possible content mime types.

setName (  self,
QString  name
)

Sets the i18n'ed name of the collection.

Parameters:
name  The new collection name.

setParent (  self,
Id  parent
)

Sets the identifier of the parent collection.

setParent (  self,
Akonadi.Collection  collection
)

Sets the parent collection.

setParentRemoteId (  self,
QString  identifier
)

Sets the parent's remote identifier.

setResource (  self,
QString  identifier
)

Sets the identifier of the resource owning the collection.

setRights (  self,
Akonadi.Collection.Rights  rights
)

Sets the rights the user has on the collection.

setStatistics (  self,
Akonadi.CollectionStatistics  statistics
)

Sets the collection statistics for the collection.

Akonadi.CollectionStatistics statistics (   self )

Returns the collection statistics of the collection.

KUrl url (   self )

Returns the collection url


Enumeration Documentation

Right

Describes rights of a collection.

Enumerator:
ReadOnly = 0x0
CanChangeItem = 0x1
CanCreateItem = 0x2
CanDeleteItem = 0x4
CanChangeCollection = 0x8
CanCreateCollection = 0x10
CanDeleteCollection = 0x20
AllRights = (CanChangeItem|CanCreateItem|CanDeleteItem|CanChangeCollection|CanCreateCollection|CanDeleteCollection)

  • Full Index

Modules

  • akonadi
  • dnssd
  • kdecore
  • kdeui
  • khtml
  • kio
  • knewstuff
  • kparts
  • kutils
  • nepomuk
  • phonon
  • plasma
  • polkitqt
  • solid
  • soprano
This documentation is maintained by Simon Edwards.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal