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 );
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();
}
}
Method Documentation
| __init__ | ( | self ) |
Creates an invalid collection.
| __init__ | ( | self, | ||
| Akonadi.Collection | other | |||
| ) |
Creates a collection from an other collection.
| __init__ | ( | self, | ||
| long | id | |||
| ) |
Create a new collection.
- Parameters:
-
id The unique identifier of the 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.
| QString name | ( | self ) |
Returns the i18n'ed name of the collection.
| Id parent | ( | self ) |
Returns the identifier of the parent collection.
- Deprecated:
- Use parentCollection()
| QString parentRemoteId | ( | self ) |
Returns the parent remote identifier.
- Note:
- This usually returns nothing for collections retrieved from the backend.
- Deprecated:
- Use parentCollection()
| 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.
| 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, | ||
| Akonadi.Collection | collection | |||
| ) |
Sets the parent collection.
- Deprecated:
- Use setParentCollection()
| setParent | ( | self, | ||
| long | parent | |||
| ) |
Sets the parent collection.
- Deprecated:
- Use setParentCollection()
| setParentRemoteId | ( | self, | ||
| QString | identifier | |||
| ) |
Sets the parent's remote identifier.
- Deprecated:
- Use setParentCollection()
| 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
Static Method Documentation
| Akonadi.Collection fromUrl | ( | KUrl | url | |
| ) |
Creates a collection from the given url.
| QString mimeType | ( | ) |
Returns the mimetype used for collections.
| Akonadi.Collection root | ( | ) |
Returns the root collection.
Enumeration Documentation
| Right |
Describes rights of a collection.
- Enumerator:
-
ReadOnly = 0x0 CanChangeItem = 0x1 CanCreateItem = 0x2 CanDeleteItem = 0x4 CanChangeCollection = 0x8 CanCreateCollection = 0x10 CanDeleteCollection = 0x20 CanLinkItem = 0x40 CanUnlinkItem = 0x80 AllRights = (CanChangeItem|CanCreateItem|CanDeleteItem|CanChangeCollection|CanCreateCollection|CanDeleteCollection)
KDE 4.5 PyKDE API Reference