Akonadi

specialcollectionattribute.cpp
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "specialcollectionattribute.h"
8#include "attributefactory.h"
9
10using namespace Akonadi;
11
12/**
13 @internal
14*/
15class Akonadi::SpecialCollectionAttributePrivate
16{
17public:
18 QByteArray mType;
19};
20
22 : d(new SpecialCollectionAttributePrivate())
23{
24 d->mType = type;
25}
26
28
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.
61namespace
62{
63bool dummySpecialCollectionAttribute()
64{
65 using namespace Akonadi;
66 AttributeFactory::registerAttribute<SpecialCollectionAttribute>();
67 return true;
68}
69
70const bool registeredSpecialCollectionAttribute = dummySpecialCollectionAttribute();
71
72} // namespace
An Attribute that stores the special collection type of a 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.
QByteArray collectionType() const
Returns the special collections type of the collection.
SpecialCollectionAttribute(const QByteArray &type=QByteArray())
Creates a new special collection attribute.
QByteArray serialized() const override
Returns a QByteArray representation of the attribute which will be storaged.
~SpecialCollectionAttribute() override
Destroys the special collection attribute.
QByteArray type() const override
Returns the type of the attribute.
SpecialCollectionAttribute * clone() const override
Creates a copy of this attribute.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Apr 27 2024 22:07:19 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.