akonadi
20 #ifndef AKONADI_ENTITY_H
21 #define AKONADI_ENTITY_H
23 #include "akonadi_export.h"
32 #include <akonadi/attribute.h>
36 #include <QtCore/QHash>
37 #include <QtCore/QSharedDataPointer>
39 #define AKONADI_DECLARE_PRIVATE( Class ) \
40 Class##Private* d_func(); \
41 const Class##Private* d_func() const; \
42 friend class Class##Private;
70 void setId(
Id identifier );
80 void setRemoteId(
const QString&
id );
85 QString remoteId()
const;
96 void setRemoteRevision(
const QString& revision );
104 QString remoteRevision()
const;
109 bool isValid()
const;
115 bool operator==(
const Entity &other )
const;
121 bool operator!=(
const Entity &other )
const;
134 bool operator<(
const Entity &other )
const;
161 void setParentCollection(
const Collection &parent );
173 void addAttribute(
Attribute *attribute );
178 void removeAttribute(
const QByteArray &name );
184 bool hasAttribute(
const QByteArray &name )
const;
194 void clearAttributes();
199 Attribute* attribute(
const QByteArray &name )
const;
220 if ( hasAttribute( dummy.type() ) ) {
221 T* attr =
dynamic_cast<T*
>( attribute( dummy.type() ) );
225 kWarning( 5250 ) <<
"Found attribute of unknown type" << dummy.type()
226 <<
". Did you forget to call AttributeFactory::registerAttribute()?";
230 addAttribute( attr );
240 if ( hasAttribute( dummy.type() ) ) {
241 T* attr =
dynamic_cast<T*
>( attribute( dummy.type() ) );
244 kWarning( 5250 ) <<
"Found attribute of unknown type" << dummy.type()
245 <<
". Did you forget to call AttributeFactory::registerAttribute()?";
257 removeAttribute( dummy.type() );
266 return hasAttribute( dummy.type() );
282 QSharedDataPointer<EntityPrivate> d_ptr;
285 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-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by
doxygen 1.8.7 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.