akonadi
Akonadi::Entity Class Reference
The base class for Item and Collection. More...
#include <entity.h>

Public Types | |
enum | CreateOption { AddIfMissing } |
typedef qint64 | Id |
Public Member Functions | |
~Entity () | |
void | addAttribute (Attribute *attribute) |
Attribute * | attribute (const QByteArray &name) const |
template<typename T > | |
T * | attribute (CreateOption option) |
template<typename T > | |
T * | attribute () const |
Attribute::List | attributes () const |
void | clearAttributes () |
bool | hasAttribute (const QByteArray &name) const |
template<typename T > | |
bool | hasAttribute () const |
Id | id () const |
bool | isValid () const |
bool | operator!= (const Entity &other) const |
Entity & | operator= (const Entity &other) |
bool | operator== (const Entity &other) const |
Collection | parentCollection () const |
Collection & | parentCollection () |
QString | remoteId () const |
QString | remoteRevision () const |
void | removeAttribute (const QByteArray &name) |
template<typename T > | |
void | removeAttribute () |
void | setId (Id identifier) |
void | setParentCollection (const Collection &parent) |
void | setRemoteId (const QString &id) |
void | setRemoteRevision (const QString &revision) |
Protected Member Functions | |
Entity (const Entity &other) |
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.
Definition at line 58 of file entity.h.
Member Typedef Documentation
typedef qint64 Akonadi::Entity::Id |
Member Enumeration Documentation
enum Akonadi::Entity::CreateOption |
Constructor & Destructor Documentation
Akonadi::Entity::~Entity | ( | ) |
Destroys the entity.
Akonadi::Entity::Entity | ( | const Entity & | other | ) | [protected] |
Creates an entity from an other
entity.
Member Function Documentation
void Akonadi::Entity::addAttribute | ( | 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.
Attribute* Akonadi::Entity::attribute | ( | const QByteArray & | name | ) | const |
Returns the attribute of the given type name
if available, 0 otherwise.
T* Akonadi::Entity::attribute | ( | CreateOption | option | ) | [inline] |
T* Akonadi::Entity::attribute | ( | ) | const [inline] |
Attribute::List Akonadi::Entity::attributes | ( | ) | const |
Returns a list of all attributes of the entity.
void Akonadi::Entity::clearAttributes | ( | ) |
Removes and deletes all attributes of the entity.
Definition at line 154 of file entity.cpp.
bool Akonadi::Entity::hasAttribute | ( | const QByteArray & | name | ) | const |
Returns true
if the entity has an attribute of the given type name
, false otherwise.
bool Akonadi::Entity::hasAttribute | ( | ) | const [inline] |
Id Akonadi::Entity::id | ( | ) | const |
Returns the unique identifier of the entity.
bool Akonadi::Entity::isValid | ( | ) | const |
Returns whether the entity is valid.
bool Akonadi::Entity::operator!= | ( | const Entity & | other | ) | const |
Returns whether the entity's id does not equal the id of the other
entity.
Definition at line 108 of file entity.cpp.
Assigns the other
to this entity and returns a reference to this entity.
bool Akonadi::Entity::operator== | ( | const Entity & | other | ) | const |
Returns whether the entity's id equals the id of the other
entity.
Collection Akonadi::Entity::parentCollection | ( | ) | const |
Returns 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
Collection& Akonadi::Entity::parentCollection | ( | ) |
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 Akonadi::Entity::remoteId | ( | ) | const |
Returns the remote id of the entity.
QString Akonadi::Entity::remoteRevision | ( | ) | const |
Returns the remote revision of the entity.
- Note:
- This method is supposed to be used by resources only.
- Since:
- 4.5
void Akonadi::Entity::removeAttribute | ( | ) | [inline] |
void Akonadi::Entity::removeAttribute | ( | const QByteArray & | name | ) |
Removes and deletes the attribute of the given type name
.
void Akonadi::Entity::setId | ( | Id | identifier | ) |
Sets the unique identifier
of the entity.
void Akonadi::Entity::setParentCollection | ( | const 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
void Akonadi::Entity::setRemoteId | ( | const QString & | id | ) |
Sets the remote id
of the entity.
void Akonadi::Entity::setRemoteRevision | ( | const QString & | revision | ) |
Sets the remote revision
of the entity.
The remote revision can be used by resources to store some revision information of the backend to detect changes there.
- Note:
- This method is supposed to be used by resources only.
- Since:
- 4.5
The documentation for this class was generated from the following files: