Akonadi

specialcollectionattribute.h
1 /*
2  SPDX-FileCopyrightText: 2009 Constantin Berzan <[email protected]>
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 
16 namespace Akonadi
17 {
18 class 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 <[email protected]>
26  * @since 4.4
27  */
28 class AKONADICORE_EXPORT SpecialCollectionAttribute : public Akonadi::Attribute
29 {
30 public:
31  /**
32  * Creates a new special collection attribute.
33  */
34  explicit SpecialCollectionAttribute(const QByteArray &type = QByteArray());
35 
36  /**
37  * Destroys the special collection attribute.
38  */
39  ~SpecialCollectionAttribute() override;
40 
41  /**
42  * Sets the special collections @p type of the collection.
43  */
44  void setCollectionType(const QByteArray &type);
45 
46  /**
47  * Returns the special collections type of the collection.
48  */
49  QByteArray collectionType() const;
50 
51  /* reimpl */
52  SpecialCollectionAttribute *clone() const override;
53  QByteArray type() const override;
54  QByteArray serialized() const override;
55  void deserialize(const QByteArray &data) override;
56 
57 private:
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:124
An Attribute that stores the special collection type of a collection.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Tue Dec 6 2022 03:53:34 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.