akonadi
20 #ifndef AKONADI_ENTITY_H
21 #define AKONADI_ENTITY_H
23 #include "akonadi_export.h"
31 #include <akonadi/attribute.h>
35 #include <QtCore/QHash>
36 #include <QtCore/QSharedDataPointer>
38 #define AKONADI_DECLARE_PRIVATE( Class ) \
39 Class##Private* d_func(); \
40 const Class##Private* d_func() const; \
41 friend class Class##Private;
69 void setId(
Id identifier );
79 void setRemoteId(
const QString&
id );
84 QString remoteId()
const;
95 void setRemoteRevision(
const QString& revision );
103 QString remoteRevision()
const;
108 bool isValid()
const;
114 bool operator==(
const Entity &other )
const;
120 bool operator!=(
const Entity &other )
const;
132 bool operator<(
const Entity &other )
const;
159 void setParentCollection(
const Collection &parent );
171 void addAttribute(
Attribute *attribute );
176 void removeAttribute(
const QByteArray &name );
182 bool hasAttribute(
const QByteArray &name )
const;
192 void clearAttributes();
197 Attribute* attribute(
const QByteArray &name )
const;
218 if ( hasAttribute( dummy.type() ) ) {
219 T* attr =
dynamic_cast<T*
>( attribute( dummy.type() ) );
223 kWarning( 5250 ) <<
"Found attribute of unknown type" << dummy.type()
224 <<
". Did you forget to call AttributeFactory::registerAttribute()?";
228 addAttribute( attr );
235 template <
typename T>
inline T* attribute()
const
238 if ( hasAttribute( dummy.type() ) ) {
239 T* attr =
dynamic_cast<T*
>( attribute( dummy.type() ) );
242 kWarning( 5250 ) <<
"Found attribute of unknown type" << dummy.type()
243 <<
". Did you forget to call AttributeFactory::registerAttribute()?";
252 template <
typename T>
inline void removeAttribute()
255 removeAttribute( dummy.type() );
261 template <
typename T>
inline bool hasAttribute()
const
264 return hasAttribute( dummy.type() );
280 QSharedDataPointer<EntityPrivate> d_ptr;
283 AKONADI_DECLARE_PRIVATE(
Entity )
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:27:35 by
doxygen 1.8.3.1 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.