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;
133 bool operator<(
const Entity &other )
const;
160 void setParentCollection(
const Collection &parent );
172 void addAttribute(
Attribute *attribute );
177 void removeAttribute(
const QByteArray &name );
183 bool hasAttribute(
const QByteArray &name )
const;
193 void clearAttributes();
198 Attribute* attribute(
const QByteArray &name )
const;
219 if ( hasAttribute( dummy.type() ) ) {
220 T* attr =
dynamic_cast<T*
>( attribute( dummy.type() ) );
224 kWarning( 5250 ) <<
"Found attribute of unknown type" << dummy.type()
225 <<
". Did you forget to call AttributeFactory::registerAttribute()?";
229 addAttribute( attr );
239 if ( hasAttribute( dummy.type() ) ) {
240 T* attr =
dynamic_cast<T*
>( attribute( dummy.type() ) );
243 kWarning( 5250 ) <<
"Found attribute of unknown type" << dummy.type()
244 <<
". Did you forget to call AttributeFactory::registerAttribute()?";
256 removeAttribute( dummy.type() );
265 return hasAttribute( dummy.type() );
281 QSharedDataPointer<EntityPrivate> d_ptr;
284 AKONADI_DECLARE_PRIVATE(
Entity )
Represents a collection of PIM items.
qint64 Id
Describes the unique id type.
T * attribute() const
Returns the attribute of the requested type or 0 if it is not available.
Provides interface for custom attributes for Entity.
T * attribute(CreateOption option)
Returns the attribute of the requested type.
The base class for Item and Collection.
QList< Attribute * > List
Describes a list of attributes.
CreateOption
Describes the options that can be passed to access attributes.
bool hasAttribute() const
Returns whether the entity has an attribute of the requested type.
void removeAttribute()
Removes and deletes the attribute of the requested type.
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Tue Nov 26 2013 09:03:17 by
doxygen 1.8.5 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.