Akonadi

indexpolicyattribute.h
1/*
2 SPDX-FileCopyrightText: 2010 Volker Krause <vkrause@kde.org>
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
14namespace Akonadi
15{
16class 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 */
26class AKONADICORE_EXPORT IndexPolicyAttribute : public Akonadi::Attribute
27{
28public:
29 /**
30 * Creates a new index policy attribute.
31 */
33
34 /**
35 * Destroys the index policy attribute.
36 */
38
39 /**
40 * Returns whether this collection is supposed to be indexed at all.
41 */
42 [[nodiscard]] 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 [[nodiscard]] QByteArray type() const override;
52 Attribute *clone() const override;
53 [[nodiscard]] QByteArray serialized() const override;
54 void deserialize(const QByteArray &data) override;
55 /// @endcond
56
57private:
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:132
virtual void deserialize(const QByteArray &data)=0
Sets the data of this attribute, using the same encoding as returned by toByteArray().
virtual QByteArray serialized() const =0
Returns a QByteArray representation of the attribute which will be storaged.
virtual Attribute * clone() const =0
Creates a copy of this attribute.
virtual QByteArray type() const =0
Returns the type of the attribute.
IndexPolicyAttribute()
Creates a new index policy attribute.
bool indexingEnabled() const
Returns whether this collection is supposed to be indexed at all.
~IndexPolicyAttribute() override
Destroys the index policy attribute.
void setIndexingEnabled(bool enable)
Sets whether this collection should be indexed at all.
Helper integration between Akonadi and Qt.
This file is part of the KDE documentation.
Documentation copyright © 1996-2025 The KDE developers.
Generated on Fri Jan 24 2025 11:49:56 by doxygen 1.13.2 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.