Akonadi

indexpolicyattribute.h
1 /*
2  SPDX-FileCopyrightText: 2010 Volker Krause <[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 <memory>
13 
14 namespace Akonadi
15 {
16 class IndexPolicyAttributePrivate;
17 
18 /**
19  * @short An attribute to specify how a collection should be indexed for searching.
20  *
21  * This attribute can be attached to any collection and should be honored by indexing
22  * agents.
23  *
24  * @since 4.6
25  */
26 class AKONADICORE_EXPORT IndexPolicyAttribute : public Akonadi::Attribute
27 {
28 public:
29  /**
30  * Creates a new index policy attribute.
31  */
33 
34  /**
35  * Destroys the index policy attribute.
36  */
37  ~IndexPolicyAttribute() override;
38 
39  /**
40  * Returns whether this collection is supposed to be indexed at all.
41  */
42  Q_REQUIRED_RESULT bool indexingEnabled() const;
43 
44  /**
45  * Sets whether this collection should be indexed at all.
46  * @param enable @c true to enable indexing, @c false to exclude this collection from indexing
47  */
48  void setIndexingEnabled(bool enable);
49 
50  /// @cond PRIVATE
51  QByteArray type() const override;
52  Attribute *clone() const override;
53  QByteArray serialized() const override;
54  void deserialize(const QByteArray &data) override;
55  /// @endcond
56 
57 private:
58  /// @cond PRIVATE
59  const std::unique_ptr<IndexPolicyAttributePrivate> d;
60  /// @endcond
61 };
62 
63 } // namespace Akonadi
Provides interface for custom attributes for Entity.
Definition: attribute.h:124
An attribute to specify how a collection should be indexed for searching.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon May 8 2023 03:52:16 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.