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

akonadi

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

#include <attributeentity.h>

Inheritance diagram for Akonadi::AttributeEntity:
Inheritance graph
[legend]

Public Types

enum  CreateOption { AddIfMissing }
 

Public Member Functions

 AttributeEntity (const AttributeEntity &other)
 
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
 
virtual AttributeEntity & operator= (const AttributeEntity &other)
 
void removeAttribute (const QByteArray &name)
 
template<typename T >
void removeAttribute ()
 

Detailed Description

Parent class for entities that can have attributes.

This is supposed to eventually share the code between Akonadi::Tag and Akonadi::Entity.

In the current form using this in Akonadi::Entity would break the implicit sharing of it's private class, so AttributeEntity::Private would need to become a parent class of EntityPrivate and use the same clone() calls etc. An even better solution is probably ot make AttributeEntity a private member of Entity, with all Attribute related member functions forwarding to this class.

Definition at line 40 of file attributeentity.h.

Member Enumeration Documentation

enum Akonadi::AttributeEntity::CreateOption

Describes the options that can be passed to access attributes.

Enumerator
AddIfMissing 

Creates the attribute if it is missing.

Definition at line 91 of file attributeentity.h.

Member Function Documentation

void AttributeEntity::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 74 of file attributeentity.cpp.

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

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

Definition at line 113 of file attributeentity.cpp.

template<typename T >
T* Akonadi::AttributeEntity::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 102 of file attributeentity.h.

template<typename T >
T* Akonadi::AttributeEntity::attribute ( ) const
inline

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

Definition at line 124 of file attributeentity.h.

Attribute::List AttributeEntity::attributes ( ) const

Returns a list of all attributes of the entity.

Definition at line 99 of file attributeentity.cpp.

void Akonadi::AttributeEntity::clearAttributes ( )

Removes and deletes all attributes of the entity.

Definition at line 104 of file attributeentity.cpp.

bool AttributeEntity::hasAttribute ( const QByteArray &  name) const

Returns true if the entity has an attribute of the given type name, false otherwise.

Definition at line 94 of file attributeentity.cpp.

template<typename T >
bool Akonadi::AttributeEntity::hasAttribute ( ) const
inline

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

Definition at line 151 of file attributeentity.h.

void AttributeEntity::removeAttribute ( const QByteArray &  name)

Removes and deletes the attribute of the given type name.

Definition at line 88 of file attributeentity.cpp.

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

Removes and deletes the attribute of the requested type.

Definition at line 142 of file attributeentity.h.


The documentation for this class was generated from the following files:
  • attributeentity.h
  • attributeentity.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:38:04 by doxygen 1.8.7 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 API Reference

Skip menu "kdepimlibs 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

Search



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