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

akonadi

  • sources
  • kde-4.12
  • kdepimlibs
  • 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 
26 using namespace Akonadi;
27 
28 class ContactMetaDataAttribute::Private
29 {
30  public:
31  QVariantMap mData;
32 };
33 
34 ContactMetaDataAttribute::ContactMetaDataAttribute()
35  : d( new Private )
36 {
37 }
38 
39 ContactMetaDataAttribute::~ContactMetaDataAttribute()
40 {
41  delete d;
42 }
43 
44 void ContactMetaDataAttribute::setMetaData( const QVariantMap &data )
45 {
46  d->mData = data;
47 }
48 
49 QVariantMap ContactMetaDataAttribute::metaData() const
50 {
51  return d->mData;
52 }
53 
54 QByteArray ContactMetaDataAttribute::type() const
55 {
56  return "contactmetadata";
57 }
58 
59 Attribute* ContactMetaDataAttribute::clone() const
60 {
61  ContactMetaDataAttribute *copy = new ContactMetaDataAttribute;
62  copy->setMetaData( d->mData );
63 
64  return copy;
65 }
66 
67 QByteArray ContactMetaDataAttribute::serialized() const
68 {
69  QByteArray data;
70  QDataStream s( &data, QIODevice::WriteOnly );
71  s.setVersion( QDataStream::Qt_4_5 );
72  s << d->mData;
73 
74  return data;
75 }
76 
77 void ContactMetaDataAttribute::deserialize( const QByteArray &data )
78 {
79  QDataStream s( data );
80  s.setVersion( QDataStream::Qt_4_5 );
81  s >> d->mData;
82 }
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:77
Akonadi::ContactMetaDataAttribute::ContactMetaDataAttribute
ContactMetaDataAttribute()
Creates a new contact meta data attribute.
Definition: contactmetadataattribute.cpp:34
Akonadi::ContactMetaDataAttribute
Attribute to store contact specific meta data.
Definition: contactmetadataattribute_p.h:38
Akonadi::ContactMetaDataAttribute::serialized
virtual QByteArray serialized() const
Returns a QByteArray representation of the attribute which will be storaged.
Definition: contactmetadataattribute.cpp:67
Akonadi::ContactMetaDataAttribute::~ContactMetaDataAttribute
~ContactMetaDataAttribute()
Destroys the contact meta data attribute.
Definition: contactmetadataattribute.cpp:39
Akonadi::ContactMetaDataAttribute::metaData
QVariantMap metaData() const
Returns the meta data.
Definition: contactmetadataattribute.cpp:49
Akonadi::Attribute
Provides interface for custom attributes for Entity.
Definition: attribute.h:138
Akonadi::ContactMetaDataAttribute::clone
virtual Attribute * clone() const
Creates a copy of this attribute.
Definition: contactmetadataattribute.cpp:59
Akonadi::ContactMetaDataAttribute::setMetaData
void setMetaData(const QVariantMap &data)
Sets the meta data.
Definition: contactmetadataattribute.cpp:44
Akonadi::ContactMetaDataAttribute::type
virtual QByteArray type() const
Returns the type of the attribute.
Definition: contactmetadataattribute.cpp:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:27 by doxygen 1.8.7 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
  • Modules
  • Related Pages

kdepimlibs API Reference

Skip menu "kdepimlibs API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kldap
  • kmbox
  • kmime
  • kpimidentities
  • kpimtextedit
  • kresources
  • ktnef
  • kxmlrpcclient
  • microblog

Search



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