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 
16 namespace Akonadi
17 {
18 class 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 <[email protected]>
48  * @see Akonadi::Attribute
49  * @since 4.4
50  */
51 class AKONADICORE_EXPORT EntityHiddenAttribute : public Attribute
52 {
53 public:
54  /**
55  * Creates a new entity hidden attribute.
56  */
58 
59  /**
60  * Destroys the entity hidden attribute.
61  */
62  ~EntityHiddenAttribute() override;
63 
64  /**
65  * Reimplemented from Attribute
66  */
67  QByteArray type() const override;
68 
69  /**
70  * Reimplemented from Attribute
71  */
72  EntityHiddenAttribute *clone() const override;
73 
74  /**
75  * Reimplemented from Attribute
76  */
77  QByteArray serialized() const override;
78 
79  /**
80  * Reimplemented from Attribute
81  */
82  void deserialize(const QByteArray &data) override;
83 
84 private:
85  /// @cond PRIVATE
86  const std::unique_ptr<EntityHiddenAttributePrivate> d;
87  /// @endcond
88 };
89 
90 } // namespace Akonadi
91 
An Attribute that marks that an entity should be hidden in the UI.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Jul 2 2022 06:41:47 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.