File indexing completed on 2024-11-24 04:50:40

0001 /*
0002     This file is part of Akonadi Contact.
0003 
0004     SPDX-FileCopyrightText: 2009 Tobias Koenig <tokoe@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 #pragma once
0010 
0011 #include <Akonadi/Attribute>
0012 
0013 #include <QVariant>
0014 
0015 #include <memory>
0016 
0017 class ContactMetaDataAttributePrivate;
0018 
0019 /**
0020  * @short Attribute to store contact specific meta data.
0021  *
0022  * @author Tobias Koenig <tokoe@kde.org>
0023  */
0024 class ContactMetaDataAttribute : public Akonadi::Attribute
0025 {
0026 public:
0027     /**
0028      * Creates a new contact meta data attribute.
0029      */
0030     ContactMetaDataAttribute();
0031 
0032     /**
0033      * Destroys the contact meta data attribute.
0034      */
0035     ~ContactMetaDataAttribute() override;
0036 
0037     /**
0038      * Sets the meta @p data.
0039      */
0040     void setMetaData(const QVariantMap &data);
0041 
0042     /**
0043      * Returns the meta data.
0044      */
0045     QVariantMap metaData() const;
0046 
0047     QByteArray type() const override;
0048     Akonadi::Attribute *clone() const override;
0049     QByteArray serialized() const override;
0050     void deserialize(const QByteArray &data) override;
0051 
0052 private:
0053     //@cond PRIVATE
0054     std::unique_ptr<ContactMetaDataAttributePrivate> const d;
0055     //@endcond
0056 };