Entity Class Reference
from PyKDE4.akonadi import *
Subclasses: Akonadi.Collection, Akonadi.Item
Namespace: Akonadi.Entity
Detailed Description
The base class for Item and Collection.
Entity is the common base class for Item and Collection that provides unique IDs and attributes handling.
This class is not meant to be used directly, use Item or Collection instead.
Enumerations | |
CreateOption | { AddIfMissing } |
Methods | |
__init__ (self, Akonadi.Entity other) | |
addAttribute (self, Akonadi.Attribute attribute) | |
Akonadi.Attribute | attribute (self, QByteArray name) |
Akonadi.Attribute.List | attributes (self) |
clearAttributes (self) | |
bool | hasAttribute (self, QByteArray name) |
Akonadi.Entity.Id | id (self) |
bool | isValid (self) |
bool | operator != (self, Akonadi.Entity other) |
bool | operator == (self, Akonadi.Entity other) |
Akonadi.Collection | parentCollection (self) |
QString | remoteId (self) |
removeAttribute (self, QByteArray name) | |
setId (self, Akonadi.Entity.Id identifier) | |
setParentCollection (self, Akonadi.Collection parent) | |
setRemoteId (self, QString id) |
Method Documentation
__init__ | ( | self, | ||
Akonadi.Entity | other | |||
) |
Creates an entity from an other entity.
addAttribute | ( | self, | ||
Akonadi.Attribute | attribute | |||
) |
Adds an attribute to the entity.
If an attribute of the same type name already exists, it is deleted and replaced with the new one.
- Parameters:
-
attribute The new attribute.
- Note:
- The entity takes the ownership of the attribute.
Akonadi.Attribute attribute | ( | self, | ||
QByteArray | name | |||
) |
Returns the attribute of the requested type or 0 if it is not available.
Akonadi.Attribute.List attributes | ( | self ) |
Returns a list of all attributes of the entity.
clearAttributes | ( | self ) |
Removes and deletes all attributes of the entity.
bool hasAttribute | ( | self, | ||
QByteArray | name | |||
) |
Returns whether the entity has an attribute of the requested type.
Akonadi.Entity.Id id | ( | self ) |
Returns the unique identifier of the entity.
bool isValid | ( | self ) |
Returns whether the entity is valid.
bool operator != | ( | self, | ||
Akonadi.Entity | other | |||
) |
Returns whether the entity's id does not equal the id of the other entity.
bool operator == | ( | self, | ||
Akonadi.Entity | other | |||
) |
Returns whether the entity's id equals the id of the other entity.
Akonadi.Collection parentCollection | ( | self ) |
Returns a reference to the parent collection of this object.
- Note:
- This will of course only return a useful value if it was explictly retrieved from the Akonadi server.
- Since:
- 4.4
QString remoteId | ( | self ) |
Returns the remote id of the entity.
removeAttribute | ( | self, | ||
QByteArray | name | |||
) |
Removes and deletes the attribute of the requested type.
setId | ( | self, | ||
Akonadi.Entity.Id | identifier | |||
) |
Sets the unique identifier of the entity.
setParentCollection | ( | self, | ||
Akonadi.Collection | parent | |||
) |
Set the parent collection of this object.
- Note:
- Calling this method has no immediate effect for the object itself, such as being moved to another collection. It is mainly relevant to provide a context for RID-based operations inside resources.
- Parameters:
-
parent The parent collection.
- Since:
- 4.4
setRemoteId | ( | self, | ||
QString | id | |||
) |
Sets the remote id of the entity.
Enumeration Documentation
CreateOption |
Describes the options that can be passed to access attributes.
- Enumerator:
-
AddIfMissing