Akonadi Contacts

contactmetadataattribute.cpp
1/*
2 This file is part of Akonadi Contact.
3
4 SPDX-FileCopyrightText: 2009 Tobias Koenig <tokoe@kde.org>
5
6 SPDX-License-Identifier: LGPL-2.0-or-later
7*/
8
9#include "contactmetadataattribute_p.h"
10
11#include <QDataStream>
12#include <QIODevice>
13
14using namespace Akonadi;
15
16class Akonadi::ContactMetaDataAttributePrivate
17{
18public:
19 QVariantMap mData;
20};
21
22ContactMetaDataAttribute::ContactMetaDataAttribute()
23 : d(new ContactMetaDataAttributePrivate)
24{
25}
26
27ContactMetaDataAttribute::~ContactMetaDataAttribute() = default;
28
29void ContactMetaDataAttribute::setMetaData(const QVariantMap &data)
30{
31 d->mData = data;
32}
33
34QVariantMap ContactMetaDataAttribute::metaData() const
35{
36 return d->mData;
37}
38
39QByteArray ContactMetaDataAttribute::type() const
40{
41 static const QByteArray sType("contactmetadata");
42 return sType;
43}
44
45Attribute *ContactMetaDataAttribute::clone() const
46{
47 auto copy = new ContactMetaDataAttribute;
48 copy->setMetaData(d->mData);
49
50 return copy;
51}
52
53QByteArray ContactMetaDataAttribute::serialized() const
54{
55 QByteArray data;
57 s.setVersion(QDataStream::Qt_4_5);
58 s << d->mData;
59
60 return data;
61}
62
63void ContactMetaDataAttribute::deserialize(const QByteArray &data)
64{
65 QDataStream s(data);
66 s.setVersion(QDataStream::Qt_4_5);
67 s >> d->mData;
68}
void setMetaData(const KIO::MetaData &metaData)
A widget for editing the display name of a contact.
KIOCORE_EXPORT CopyJob * copy(const QList< QUrl > &src, const QUrl &dest, JobFlags flags=DefaultFlags)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Nov 22 2024 12:08:53 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.