Akonadi

entityhiddenattribute.h
1/******************************************************************************
2 *
3 * SPDX-FileCopyrightText: 2009 Szymon Stefanek <s.stefanek at gmail dot com>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 *
7 *****************************************************************************/
8
9#pragma once
10
11#include "akonadicore_export.h"
12#include "attribute.h"
13
14#include <memory>
15
16namespace Akonadi
17{
18class EntityHiddenAttributePrivate;
19
20/**
21 * @short An Attribute that marks that an entity should be hidden in the UI.
22 *
23 * This class represents the attribute of all hidden items. The hidden
24 * items shouldn't be displayed in UI applications (unless in some kind
25 * of "debug" mode).
26 *
27 * Example:
28 *
29 * @code
30 *
31 * using namespace Akonadi;
32 *
33 * ...
34 * // hide a collection by setting the hidden attribute
35 * Collection collection = collectionFetchJob->collections().at(0);
36 * collection.attribute<EntityHiddenAttribute>( Collection::AddIfMissing );
37 * new CollectionModifyJob( collection, this ); // save back to storage
38 *
39 * // check if the collection is hidden
40 * if ( collection.hasAttribute<EntityHiddenAttribute>() )
41 * qDebug() << "collection is hidden";
42 * else
43 * qDebug() << "collection is visible";
44 *
45 * @endcode
46 *
47 * @author Szymon Stefanek <s.stefanek@gmail.com>
48 * @see Akonadi::Attribute
49 * @since 4.4
50 */
51class AKONADICORE_EXPORT EntityHiddenAttribute : public Attribute
52{
53public:
54 /**
55 * Creates a new entity hidden attribute.
56 */
58
59 /**
60 * Destroys the entity hidden attribute.
61 */
63
64 /**
65 * Reimplemented from Attribute
66 */
67 [[nodiscard]] QByteArray type() const override;
68
69 /**
70 * Reimplemented from Attribute
71 */
72 EntityHiddenAttribute *clone() const override;
73
74 /**
75 * Reimplemented from Attribute
76 */
77 [[nodiscard]] QByteArray serialized() const override;
78
79 /**
80 * Reimplemented from Attribute
81 */
82 void deserialize(const QByteArray &data) override;
83
84private:
85 /// @cond PRIVATE
86 const std::unique_ptr<EntityHiddenAttributePrivate> d;
87 /// @endcond
88};
89
90} // namespace Akonadi
Provides interface for custom attributes for Entity.
Definition attribute.h:132
An Attribute that marks that an entity should be hidden in the UI.
~EntityHiddenAttribute() override
Destroys the entity hidden attribute.
EntityHiddenAttribute()
Creates a new entity hidden attribute.
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.