1/*
2 Copyright (c) 2010 Volker Krause <vkrause@kde.org>
3
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
8
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17 02110-1301, USA.
18*/
19
20#ifndef AKONADI_INDEXPOLICYATTRIBUTE_H
21#define AKONADI_INDEXPOLICYATTRIBUTE_H
22
23#include <akonadi/attribute.h>
24
25namespace Akonadi {
26
27/**
28 * @short An attribute to specify how a collection should be indexed for searching.
29 *
30 * This attribute can be attached to any collection and should be honored by indexing
31 * agents.
32 *
33 * @since 4.6
34 */
35class AKONADI_EXPORT IndexPolicyAttribute : public Akonadi::Attribute
36{
37public:
38 /**
39 * Creates a new index policy attribute.
40 */
41 IndexPolicyAttribute();
42
43 /**
44 * Destroys the index policy attribute.
45 */
46 ~IndexPolicyAttribute();
47
48 /**
49 * Returns whether this collection is supposed to be indexed at all.
50 */
51 bool indexingEnabled() const;
52
53 /**
54 * Sets whether this collection should be indexed at all.
55 * @param enable @c true to enable indexing, @c false to exclude this collection from indexing
56 */
57 void setIndexingEnabled(bool enable);
58
59 //@cond PRIVATE
60 virtual QByteArray type() const;
61 virtual Attribute *clone() const;
62 virtual QByteArray serialized() const;
63 virtual void deserialize(const QByteArray &data);
64 //@endcond
65
66private:
67 //@cond PRIVATE
68 class Private;
69 Private *const d;
70 //@endcond
71};
72
73}
74
75#endif
76