Akonadi

entityannotationsattribute.h
1 /*
2  * SPDX-FileCopyrightText: 2008 Omat Holding B.V. <[email protected]>
3  * SPDX-FileCopyrightText: 2014 Christian Mollekopf <[email protected]>
4  *
5  * SPDX-License-Identifier: LGPL-2.0-or-later
6  */
7 
8 #pragma once
9 
10 #include "akonadicore_export.h"
11 #include "attribute.h"
12 
13 #include <QMap>
14 
15 namespace Akonadi
16 {
17 /**
18  * An attribute for annotations.
19  *
20  * The attribute is inspired by RFC5257(IMAP ANNOTATION) and RFC5464(IMAP METADATA), but serves
21  * the purpose of RFC5257.
22  *
23  * For a private note annotation the entry name is:
24  * /private/comment
25  * for a shared note:
26  * /shared/comment
27  *
28  * @since 4.13
29  */
30 class AKONADICORE_EXPORT EntityAnnotationsAttribute : public Akonadi::Attribute
31 {
32 public:
33  explicit EntityAnnotationsAttribute() = default;
34  explicit EntityAnnotationsAttribute(const QMap<QByteArray, QByteArray> &annotations);
35 
36  void setAnnotations(const QMap<QByteArray, QByteArray> &annotations);
37  QMap<QByteArray, QByteArray> annotations() const;
38 
39  void insert(const QByteArray &key, const QString &value);
40  QString value(const QByteArray &key) const;
41  bool contains(const QByteArray &key) const;
42 
43  QByteArray type() const override;
44  Attribute *clone() const override;
45  QByteArray serialized() const override;
46  void deserialize(const QByteArray &data) override;
47 
48 private:
49  QMap<QByteArray, QByteArray> mAnnotations;
50 };
51 
52 } // namespace Akonadi
53 
Provides interface for custom attributes for Entity.
Definition: attribute.h:124
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jul 2 2022 06:41:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.