akonadi
Akonadi::Entity Class Reference
#include <entity.h>

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 55 of file entity.h.
Public Types | |
enum | CreateOption { AddIfMissing } |
typedef qint64 | Id |
Public Member Functions | |
void | addAttribute (Attribute *attribute) |
template<typename T> | |
T * | attribute () const |
template<typename T> | |
T * | attribute (CreateOption option) |
Attribute * | attribute (const QByteArray &name) const |
Attribute::List | attributes () const |
void | clearAttributes () |
template<typename T> | |
bool | hasAttribute () |
bool | hasAttribute (const QByteArray &name) const |
Id | id () const |
bool | isValid () const |
bool | operator!= (const Entity &other) const |
Entity & | operator= (const Entity &other) |
bool | operator== (const Entity &other) const |
QString | remoteId () const |
template<typename T> | |
void | removeAttribute () |
void | removeAttribute (const QByteArray &name) |
void | setId (Id identifier) |
void | setRemoteId (const QString &id) |
~Entity () | |
Protected Member Functions | |
Entity (const Entity &other) |
Member Typedef Documentation
typedef qint64 Akonadi::Entity::Id |
Member Enumeration Documentation
Constructor & Destructor Documentation
Entity::~Entity | ( | ) |
Entity::Entity | ( | const Entity & | other | ) | [protected] |
Member Function Documentation
void 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.
Definition at line 82 of file entity.cpp.
T* Akonadi::Entity::attribute | ( | ) | const [inline] |
T* Akonadi::Entity::attribute | ( | CreateOption | option | ) | [inline] |
Attribute * Entity::attribute | ( | const QByteArray & | name | ) | const |
Returns the attribute of the given type name
if available, 0 otherwise.
Definition at line 117 of file entity.cpp.
Attribute::List Entity::attributes | ( | ) | const |
void Akonadi::Entity::clearAttributes | ( | ) |
bool Akonadi::Entity::hasAttribute | ( | ) | [inline] |
bool Entity::hasAttribute | ( | const QByteArray & | name | ) | const |
Returns true
if the entity has an attribute of the given type name
, false otherwise.
Definition at line 98 of file entity.cpp.
Entity::Id Entity::id | ( | ) | const |
bool Entity::isValid | ( | ) | const |
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 69 of file entity.cpp.
Assigns the other
to this entity and returns a reference to this entity.
Definition at line 74 of file entity.cpp.
bool Entity::operator== | ( | const Entity & | other | ) | const |
Returns whether the entity's id equals the id of the other
entity.
Definition at line 64 of file entity.cpp.
QString Entity::remoteId | ( | ) | const |
void Akonadi::Entity::removeAttribute | ( | ) | [inline] |
void Entity::removeAttribute | ( | const QByteArray & | name | ) |
void Entity::setId | ( | Id | identifier | ) |
void Entity::setRemoteId | ( | const QString & | id | ) |
The documentation for this class was generated from the following files: