• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • Entity
Public Types | Public Member Functions | Protected Member Functions | List of all members
Akonadi::Entity Class Reference

#include <entity.h>

Inheritance diagram for Akonadi::Entity:
Akonadi::Collection Akonadi::Item

Public Types

enum  CreateOption { AddIfMissing }
 
typedef qint64 Id
 

Public Member Functions

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
 
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)
 
 ~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.

Author
Tobias Koenig tokoe.nosp@m.@kde.nosp@m..org

Definition at line 58 of file entity.h.

Member Typedef Documentation

typedef qint64 Akonadi::Entity::Id

Describes the unique id type.

Definition at line 64 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 202 of file entity.h.

Constructor & Destructor Documentation

Entity::Entity ( const Entity &  other)
protected

Creates an entity from an other entity.

Definition at line 54 of file entity.cpp.

Entity::~Entity ( )
protected

Destroys the entity.

Definition at line 64 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
attributeThe new attribute.
Note
The entity takes the ownership of the attribute.

Definition at line 127 of file entity.cpp.

Attribute * Entity::attribute ( const QByteArray &  name) const

Returns the attribute of the given type name if available, 0 otherwise.

Definition at line 166 of file entity.cpp.

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
optionThe create options.

Definition at line 213 of file entity.h.

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 235 of file entity.h.

Attribute::List Entity::attributes ( ) const

Returns a list of all attributes of the entity.

Definition at line 152 of file entity.cpp.

void Akonadi::Entity::clearAttributes ( )

Removes and deletes all attributes of the entity.

Definition at line 157 of file entity.cpp.

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 147 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 261 of file entity.h.

Entity::Id Entity::id ( ) const

Returns the unique identifier of the entity.

Definition at line 73 of file entity.cpp.

bool Entity::isValid ( ) const

Returns whether the entity is valid.

Definition at line 98 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 108 of file entity.cpp.

bool Akonadi::Entity::operator< ( const Entity &  other) const

For use with containers only.

Since
4.8

Definition at line 122 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 113 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 103 of file entity.cpp.

Collection 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

Definition at line 187 of file entity.cpp.

Collection & 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

Definition at line 179 of file entity.cpp.

QString Entity::remoteId ( ) const

Returns the remote id of the entity.

Definition at line 83 of file entity.cpp.

QString Entity::remoteRevision ( ) const

Returns the remote revision of the entity.

Note
This method is supposed to be used by resources only.
Since
4.5

Definition at line 93 of file entity.cpp.

void Entity::removeAttribute ( const QByteArray &  name)

Removes and deletes the attribute of the given type name.

Definition at line 141 of file entity.cpp.

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

Removes and deletes the attribute of the requested type.

Definition at line 252 of file entity.h.

void Entity::setId ( Id  identifier)

Sets the unique identifier of the entity.

Definition at line 68 of file entity.cpp.

void 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
parentThe parent collection.
Since
4.4

Definition at line 196 of file entity.cpp.

void Entity::setRemoteId ( const QString &  id)

Sets the remote id of the entity.

Definition at line 78 of file entity.cpp.

void 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

Definition at line 88 of file entity.cpp.


The documentation for this class was generated from the following files:
  • entity.h
  • entity.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:48 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal