9#include "akonadicore_export.h"
13#include <QSharedPointer>
25class AKONADICORE_EXPORT
Tag
39 static const char PLAIN[];
49 static const char GENERIC[];
64 Tag &operator=(const
Tag &);
65 Tag &operator=(
Tag &&) noexcept;
67 bool operator==(const
Tag &) const;
68 bool operator!=(const
Tag &) const;
70 static
Tag fromUrl(const
QUrl &url);
93 bool hasAttribute(const
QByteArray &name) const;
103 void clearAttributes();
127 inline T *attribute(CreateOption option = DontCreate);
133 inline const T *attribute()
const;
139 inline void removeAttribute();
145 inline bool hasAttribute()
const;
155 void setId(Id identifier);
171 void setName(
const QString &name);
174 void setParent(
const Tag &parent);
177 bool isValid()
const;
183 bool isImmutable()
const;
192 void markAttributeModified(
const QByteArray &type);
197 friend class ProtocolHelper;
203AKONADICORE_EXPORT
size_t qHash(
const Akonadi::Tag &,
size_t sed = 0) noexcept;
209 markAttributeModified(type);
210 if (hasAttribute(type)) {
211 T *attr =
dynamic_cast<T *
>(attribute(type));
212 if (checkAttribute(attr, type)) {
215 }
else if (option == AddIfMissing) {
229 const T *attr =
dynamic_cast<const T *
>(
attribute(type));
230 if (checkAttribute(attr, type)) {
Provides interface for custom attributes for Entity.
Job that fetches tags from the Akonadi storage.
Job that modifies a tag in the Akonadi storage.
void removeAttribute()
Removes and deletes the attribute of the requested type.
CreateOption
Describes the options that can be passed to access attributes.
@ AddIfMissing
Creates the attribute if it is missing.
const T * attribute() const
Returns the attribute of the requested type or 0 if it is not available.
bool hasAttribute() const
Returns whether the entity has an attribute of the requested type.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:30 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.