Akonadi

collectioncolorattribute.h
1/*
2 * SPDX-FileCopyrightText: 2015 Sandro Knauß <knauss@kolabsys.com>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#pragma once
8
9#include "akonadicore_export.h"
10
11#include "attribute.h"
12
13#include <QColor>
14
15namespace Akonadi
16{
17/**
18 * @short Attribute that stores colors of a collection.
19 *
20 * Storing color in Akonadi makes it possible to sync them between client and server.
21 *
22 * @author Sandro Knauß <knauss@kolabsys.com>
23 * @since 5.3
24 */
25
26class AKONADICORE_EXPORT CollectionColorAttribute : public Akonadi::Attribute
27{
28public:
29 explicit CollectionColorAttribute() = default;
30 explicit CollectionColorAttribute(const QColor &color);
31
32 ~CollectionColorAttribute() override = default;
33
34 void setColor(const QColor &color);
35 [[nodiscard]] QColor color() const;
36
37 [[nodiscard]] QByteArray type() const override;
38 CollectionColorAttribute *clone() const override;
39 [[nodiscard]] QByteArray serialized() const override;
40 void deserialize(const QByteArray &data) override;
41
42private:
43 QColor mColor;
44};
45
46} // namespace Akonadi
Provides interface for custom attributes for Entity.
Definition attribute.h:132
Attribute that stores colors of a collection.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 6 2024 12:00:59 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.