Akonadi

specialcollectionattribute.cpp
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #include "specialcollectionattribute.h"
8 #include "attributefactory.h"
9 
10 using namespace Akonadi;
11 
12 /**
13  @internal
14 */
15 class Akonadi::SpecialCollectionAttributePrivate
16 {
17 public:
18  QByteArray mType;
19 };
20 
22  : d(new SpecialCollectionAttributePrivate())
23 {
24  d->mType = type;
25 }
26 
28 
30 {
31  return new SpecialCollectionAttribute(d->mType);
32 }
33 
35 {
36  static const QByteArray sType("SpecialCollectionAttribute");
37  return sType;
38 }
39 
41 {
42  return d->mType;
43 }
44 
46 {
47  d->mType = data;
48 }
49 
51 {
52  d->mType = type;
53 }
54 
56 {
57  return d->mType;
58 }
59 
60 // Register the attribute when the library is loaded.
61 namespace
62 {
63 bool dummySpecialCollectionAttribute()
64 {
65  using namespace Akonadi;
66  AttributeFactory::registerAttribute<SpecialCollectionAttribute>();
67  return true;
68 }
69 
70 const bool registeredSpecialCollectionAttribute = dummySpecialCollectionAttribute();
71 
72 } // namespace
~SpecialCollectionAttribute() override
Destroys the special collection attribute.
QByteArray collectionType() const
Returns the special collections type of the collection.
void deserialize(const QByteArray &data) override
Sets the data of this attribute, using the same encoding as returned by toByteArray().
void setCollectionType(const QByteArray &type)
Sets the special collections type of the collection.
An Attribute that stores the special collection type of a collection.
QByteArray serialized() const override
Returns a QByteArray representation of the attribute which will be storaged.
QByteArray type() const override
Returns the type of the attribute.
SpecialCollectionAttribute * clone() const override
Creates a copy of this attribute.
SpecialCollectionAttribute(const QByteArray &type=QByteArray())
Creates a new special collection attribute.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Dec 6 2022 03:53:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.