File indexing completed on 2024-11-10 04:40:27

0001 /*
0002   SPDX-FileCopyrightText: 2008 Omat Holding B.V. <info@omat.nl>
0003 
0004   SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #pragma once
0008 
0009 #include "attribute.h"
0010 
0011 #include <QMap>
0012 
0013 namespace Akonadi
0014 {
0015 
0016 /**
0017  *  Collection annotations attribute.
0018  *
0019  *  This is primarily meant for storing IMAP ANNOTATION (RFC5257) data for resources
0020  *  supporting that.
0021  *
0022  *  @since 5.23.43
0023  */
0024 class AKONADICORE_EXPORT CollectionAnnotationsAttribute : public Akonadi::Attribute
0025 {
0026 public:
0027     CollectionAnnotationsAttribute();
0028     explicit CollectionAnnotationsAttribute(const QMap<QByteArray, QByteArray> &annotations);
0029     ~CollectionAnnotationsAttribute() override = default;
0030 
0031     void setAnnotations(const QMap<QByteArray, QByteArray> &annotations);
0032     QMap<QByteArray, QByteArray> annotations() const;
0033 
0034     QByteArray type() const override;
0035     CollectionAnnotationsAttribute *clone() const override;
0036     QByteArray serialized() const override;
0037     void deserialize(const QByteArray &data) override;
0038 
0039     bool operator==(const CollectionAnnotationsAttribute &other) const;
0040 
0041 private:
0042     QMap<QByteArray, QByteArray> mAnnotations;
0043 };
0044 
0045 }