• 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
specialcollectionattribute.cpp
1 /*
2  Copyright 2009 Constantin Berzan <exit3219@gmail.com>
3 
4  This library is free software; you can redistribute it and/or modify it
5  under the terms of the GNU Library General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or (at your
7  option) any later version.
8 
9  This library is distributed in the hope that it will be useful, but WITHOUT
10  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12  License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to the
16  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  02110-1301, USA.
18 */
19 
20 #include "specialcollectionattribute_p.h"
21 
22 #include <KDebug>
23 
24 #include <akonadi/attributefactory.h>
25 
26 using namespace Akonadi;
27 
31 class SpecialCollectionAttribute::Private
32 {
33  public:
34  QByteArray mType;
35 };
36 
37 SpecialCollectionAttribute::SpecialCollectionAttribute( const QByteArray &type )
38  : d( new Private )
39 {
40  d->mType = type;
41 }
42 
43 SpecialCollectionAttribute::~SpecialCollectionAttribute()
44 {
45  delete d;
46 }
47 
48 SpecialCollectionAttribute* SpecialCollectionAttribute::clone() const
49 {
50  return new SpecialCollectionAttribute( d->mType );
51 }
52 
53 QByteArray SpecialCollectionAttribute::type() const
54 {
55  static const QByteArray sType( "SpecialCollectionAttribute" );
56  return sType;
57 }
58 
59 QByteArray SpecialCollectionAttribute::serialized() const
60 {
61  return d->mType;
62 }
63 
64 void SpecialCollectionAttribute::deserialize( const QByteArray &data )
65 {
66  d->mType = data;
67 }
68 
69 void SpecialCollectionAttribute::setCollectionType( const QByteArray &type )
70 {
71  d->mType = type;
72 }
73 
74 QByteArray SpecialCollectionAttribute::collectionType() const
75 {
76  return d->mType;
77 }
78 
79 // Register the attribute when the library is loaded.
80 namespace {
81 
82 bool dummySpecialCollectionAttribute()
83 {
84  using namespace Akonadi;
85  AttributeFactory::registerAttribute<SpecialCollectionAttribute>();
86  return true;
87 }
88 
89 const bool registeredSpecialCollectionAttribute = dummySpecialCollectionAttribute();
90 
91 }
Akonadi::SpecialCollectionAttribute
An Attribute that stores the special collection type of a collection.
Definition: specialcollectionattribute_p.h:39
Akonadi::SpecialCollectionAttribute::setCollectionType
void setCollectionType(const QByteArray &type)
Sets the special collections type of the collection.
Definition: specialcollectionattribute.cpp:69
Akonadi::SpecialCollectionAttribute::clone
virtual SpecialCollectionAttribute * clone() const
Creates a copy of this attribute.
Definition: specialcollectionattribute.cpp:48
Akonadi::SpecialCollectionAttribute::type
virtual QByteArray type() const
Returns the type of the attribute.
Definition: specialcollectionattribute.cpp:53
Akonadi::SpecialCollectionAttribute::~SpecialCollectionAttribute
virtual ~SpecialCollectionAttribute()
Destroys the special collection attribute.
Definition: specialcollectionattribute.cpp:43
Akonadi::SpecialCollectionAttribute::SpecialCollectionAttribute
SpecialCollectionAttribute(const QByteArray &type=QByteArray())
Creates a new special collection attribute.
Definition: specialcollectionattribute.cpp:37
Akonadi::SpecialCollectionAttribute::collectionType
QByteArray collectionType() const
Returns the special collections type of the collection.
Definition: specialcollectionattribute.cpp:74
Akonadi::SpecialCollectionAttribute::serialized
virtual QByteArray serialized() const
Returns a QByteArray representation of the attribute which will be storaged.
Definition: specialcollectionattribute.cpp:59
Akonadi::SpecialCollectionAttribute::deserialize
virtual void deserialize(const QByteArray &data)
Sets the data of this attribute, using the same encoding as returned by toByteArray().
Definition: specialcollectionattribute.cpp:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:00:28 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