akonadi
22 #include "collection.h"
33 static void assignEntityPrivate(QSharedDataPointer<EntityPrivate> &one,
const QSharedDataPointer<EntityPrivate> &other)
49 QSharedDataPointer<EntityPrivate> temp = other;
55 assignEntityPrivate(d_ptr, other.d_ptr);
79 d_ptr->mRemoteId =
id;
84 return d_ptr->mRemoteId;
89 d_ptr->mRemoteRevision = revision;
94 return d_ptr->mRemoteRevision;
99 return (d_ptr->mId >= 0);
105 return (!
isValid() && !other.
isValid()) || (d_ptr->mId == other.d_ptr->mId);
110 return (isValid() || other.
isValid()) && (d_ptr->mId != other.d_ptr->mId);
115 if (
this != &other) {
116 assignEntityPrivate(d_ptr, other.d_ptr);
124 return d_ptr->mId < other.d_ptr->mId;
130 Attribute *existing = d_ptr->mAttributes.value(attr->
type());
132 if (attr == existing) {
135 d_ptr->mAttributes.remove(attr->
type());
138 d_ptr->mAttributes.insert(attr->
type(), attr);
139 d_ptr->mDeletedAttributes.remove(attr->
type());
144 d_ptr->mDeletedAttributes.insert(type);
145 delete d_ptr->mAttributes.take(type);
150 return d_ptr->mAttributes.contains(type);
155 return d_ptr->mAttributes.values();
160 foreach (
Attribute *attr, d_ptr->mAttributes) {
161 d_ptr->mDeletedAttributes.insert(attr->
type());
164 d_ptr->mAttributes.clear();
169 return d_ptr->mAttributes.value(type);
174 return qHash(entity.
id());
179 if (!d_ptr->mParent) {
182 return *(d_ptr->mParent);
187 if (!d_ptr->mParent) {
188 return *(s_defaultParentCollection);
190 return *(d_ptr->mParent);
196 delete d_ptr->mParent;
200 AKONADI_DEFINE_PRIVATE(
Entity)
void clearAttributes()
Removes and deletes all attributes of the entity.
Collection parentCollection() const
Returns the parent collection of this object.
T * attribute() const
Returns the attribute of the requested type or 0 if it is not available.
QString remoteRevision() const
Returns the remote revision of the entity.
bool operator<(const Entity &other) const
virtual QByteArray type() const =0
Returns the type of the attribute.
Represents a collection of PIM items.
Provides interface for custom attributes for Entity.
void setId(Id identifier)
Sets the unique identifier of the entity.
Attribute::List attributes() const
Returns a list of all attributes of the entity.
void setRemoteRevision(const QString &revision)
Sets the remote revision of the entity.
~Entity()
Destroys the entity.
void setRemoteId(const QString &id)
Sets the remote id of the entity.
bool operator==(const Entity &other) const
Returns whether the entity's id equals the id of the other entity.
qint64 Id
Describes the unique id type.
void addAttribute(Attribute *attribute)
Adds an attribute to the entity.
bool isValid() const
Returns whether the entity is valid.
bool operator!=(const Entity &other) const
Returns whether the entity's id does not equal the id of the other entity.
void setParentCollection(const Collection &parent)
Set the parent collection of this object.
void removeAttribute()
Removes and deletes the attribute of the requested type.
QList< Attribute * > List
Describes a list of attributes.
bool hasAttribute() const
Returns whether the entity has an attribute of the requested type.
Id id() const
Returns the unique identifier of the entity.
QString remoteId() const
Returns the remote id of the entity.
The base class for Item and Collection.
Entity & operator=(const Entity &other)
Assigns the other to this entity and returns a reference to this entity.
Entity(const Entity &other)
Creates an entity from an other entity.
FreeBusyManager::Singleton.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jan 29 2020 00:00:00 by
doxygen 1.8.17 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.