Akonadi

specialcollectionattribute.h
1/*
2 SPDX-FileCopyrightText: 2009 Constantin Berzan <exit3219@gmail.com>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#pragma once
8
9#include "akonadicore_export.h"
10#include "attribute.h"
11
12#include <QByteArray>
13
14#include <memory>
15
16namespace Akonadi
17{
18class SpecialCollectionAttributePrivate;
19
20/**
21 * @short An Attribute that stores the special collection type of a collection.
22 *
23 * All collections registered with SpecialCollections must have this attribute set.
24 *
25 * @author Constantin Berzan <exit3219@gmail.com>
26 * @since 4.4
27 */
28class AKONADICORE_EXPORT SpecialCollectionAttribute : public Akonadi::Attribute
29{
30public:
31 /**
32 * Creates a new special collection attribute.
33 */
35
36 /**
37 * Destroys the special collection attribute.
38 */
40
41 /**
42 * Sets the special collections @p type of the collection.
43 */
45
46 /**
47 * Returns the special collections type of the collection.
48 */
49 [[nodiscard]] QByteArray collectionType() const;
50
51 /* reimpl */
52 SpecialCollectionAttribute *clone() const override;
53 [[nodiscard]] QByteArray type() const override;
54 [[nodiscard]] QByteArray serialized() const override;
55 void deserialize(const QByteArray &data) override;
56
57private:
58 /// @cond PRIVATE
59 const std::unique_ptr<SpecialCollectionAttributePrivate> d;
60 /// @endcond
61};
62
63} // namespace Akonadi
Provides interface for custom attributes for Entity.
Definition attribute.h:132
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-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:56 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.