• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • akonadi
  • contact
contactmetadataattribute.cpp
1/*
2 This file is part of Akonadi Contact.
3
4 Copyright (c) 2009 Tobias Koenig <tokoe@kde.org>
5
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Library General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or (at your
9 option) any later version.
10
11 This library is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
14 License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to the
18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 02110-1301, USA.
20*/
21
22#include "contactmetadataattribute_p.h"
23
24#include <QtCore/QDataStream>
25
26using namespace Akonadi;
27
28class ContactMetaDataAttribute::Private
29{
30 public:
31 QVariantMap mData;
32};
33
34ContactMetaDataAttribute::ContactMetaDataAttribute()
35 : d( new Private )
36{
37}
38
39ContactMetaDataAttribute::~ContactMetaDataAttribute()
40{
41 delete d;
42}
43
44void ContactMetaDataAttribute::setMetaData( const QVariantMap &data )
45{
46 d->mData = data;
47}
48
49QVariantMap ContactMetaDataAttribute::metaData() const
50{
51 return d->mData;
52}
53
54QByteArray ContactMetaDataAttribute::type() const
55{
56 static const QByteArray sType( "contactmetadata" );
57 return sType;
58}
59
60Attribute* ContactMetaDataAttribute::clone() const
61{
62 ContactMetaDataAttribute *copy = new ContactMetaDataAttribute;
63 copy->setMetaData( d->mData );
64
65 return copy;
66}
67
68QByteArray ContactMetaDataAttribute::serialized() const
69{
70 QByteArray data;
71 QDataStream s( &data, QIODevice::WriteOnly );
72 s.setVersion( QDataStream::Qt_4_5 );
73 s << d->mData;
74
75 return data;
76}
77
78void ContactMetaDataAttribute::deserialize( const QByteArray &data )
79{
80 QDataStream s( data );
81 s.setVersion( QDataStream::Qt_4_5 );
82 s >> d->mData;
83}
Akonadi::Attribute
Provides interface for custom attributes for Entity.
Definition attribute.h:139
Akonadi::ContactMetaDataAttribute
Attribute to store contact specific meta data.
Definition contactmetadataattribute_p.h:39
Akonadi::ContactMetaDataAttribute::deserialize
virtual void deserialize(const QByteArray &data)
Sets the data of this attribute, using the same encoding as returned by toByteArray().
Definition contactmetadataattribute.cpp:78
Akonadi::ContactMetaDataAttribute::ContactMetaDataAttribute
ContactMetaDataAttribute()
Creates a new contact meta data attribute.
Definition contactmetadataattribute.cpp:34
Akonadi::ContactMetaDataAttribute::type
virtual QByteArray type() const
Returns the type of the attribute.
Definition contactmetadataattribute.cpp:54
Akonadi::ContactMetaDataAttribute::metaData
QVariantMap metaData() const
Returns the meta data.
Definition contactmetadataattribute.cpp:49
Akonadi::ContactMetaDataAttribute::~ContactMetaDataAttribute
~ContactMetaDataAttribute()
Destroys the contact meta data attribute.
Definition contactmetadataattribute.cpp:39
Akonadi::ContactMetaDataAttribute::clone
virtual Attribute * clone() const
Creates a copy of this attribute.
Definition contactmetadataattribute.cpp:60
Akonadi::ContactMetaDataAttribute::serialized
virtual QByteArray serialized() const
Returns a QByteArray representation of the attribute which will be storaged.
Definition contactmetadataattribute.cpp:68
Akonadi::ContactMetaDataAttribute::setMetaData
void setMetaData(const QVariantMap &data)
Sets the meta data.
Definition contactmetadataattribute.cpp:44
Akonadi
FreeBusyManager::Singleton.
Definition actionstatemanager_p.h:28
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

Skip menu "akonadi"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • Related Pages

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal