• Skip to content
  • Skip to link menu
KDE 4.3 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

Akonadi::Entity

Akonadi::Entity Class Reference

The base class for Item and Collection. More...

#include <entity.h>

Inheritance diagram for Akonadi::Entity:

Inheritance graph
[legend]

List of all members.


Public Types


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 () const
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)

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.

Author:
Tobias Koenig <tokoe@kde.org>

Definition at line 57 of file entity.h.


Member Typedef Documentation

typedef qint64 Akonadi::Entity::Id

Describes the unique id type.

Definition at line 63 of file entity.h.


Member Enumeration Documentation

enum Akonadi::Entity::CreateOption

Describes the options that can be passed to access attributes.

Enumerator:
AddIfMissing  Creates the attribute if it is missing.

Definition at line 153 of file entity.h.


Constructor & Destructor Documentation

Entity::~Entity (  ) 

Destroys the entity.

Definition at line 35 of file entity.cpp.

Entity::Entity ( const Entity &  other  )  [protected]

Creates an entity from an other entity.

Definition at line 25 of file entity.cpp.


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.

template<typename T >
T* Akonadi::Entity::attribute (  )  const [inline]

Returns the attribute of the requested type or 0 if it is not available.

Definition at line 186 of file entity.h.

template<typename T >
T* Akonadi::Entity::attribute ( CreateOption  option  )  [inline]

Returns the attribute of the requested type.

If the entity has no attribute of that type yet, a new one is created and added to the entity.

Parameters:
option The create options.

Definition at line 165 of file entity.h.

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

Returns a list of all attributes of the entity.

Definition at line 103 of file entity.cpp.

void Akonadi::Entity::clearAttributes (  ) 

Removes and deletes all attributes of the entity.

Definition at line 108 of file entity.cpp.

template<typename T >
bool Akonadi::Entity::hasAttribute (  )  const [inline]

Returns whether the entity has an attribute of the requested type.

Definition at line 212 of file entity.h.

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

Returns the unique identifier of the entity.

Definition at line 44 of file entity.cpp.

bool Entity::isValid (  )  const

Returns whether the entity is valid.

Definition at line 59 of file entity.cpp.

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.

Entity & Entity::operator= ( const Entity &  other  ) 

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

Returns the remote id of the entity.

Definition at line 54 of file entity.cpp.

template<typename T >
void Akonadi::Entity::removeAttribute (  )  [inline]

Removes and deletes the attribute of the requested type.

Definition at line 203 of file entity.h.

void Entity::removeAttribute ( const QByteArray &  name  ) 

Removes and deletes the attribute of the given type name.

Definition at line 90 of file entity.cpp.

void Entity::setId ( Id  identifier  ) 

Sets the unique identifier of the entity.

Definition at line 39 of file entity.cpp.

void Entity::setRemoteId ( const QString &  id  ) 

Sets the remote id of the entity.

Definition at line 49 of file entity.cpp.


The documentation for this class was generated from the following files:
  • entity.h
  • entity.cpp

akonadi

Skip menu "akonadi"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.8
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal