Prepare future 5.1.1
[kdepim.git] / kaddressbook / categoryselectwidget.h
blob50b0891e057338a6057c0d92055c84e35804a7d3
1 /*
2 Copyright (c) 2014 Jonathan Marten <jjm@keelhaul.me.uk>
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.
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.
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.
20 #ifndef CATEGORYSELECTWIDGET_H
21 #define CATEGORYSELECTWIDGET_H
23 #include <qwidget.h>
24 #include <AkonadiCore/tag.h>
26 class CategorySelectWidgetPrivate;
28 /**
29 * @short A widget to specify a category (tag) filter.
31 * @since 4.14
32 * @author Jonathan Marten
33 **/
35 class CategorySelectWidget : public QWidget
37 Q_OBJECT
38 Q_DECLARE_PRIVATE(CategorySelectWidget)
40 public:
41 /**
42 * Constructor.
44 * @param parent The parent widget
45 **/
46 explicit CategorySelectWidget(QWidget *parent = Q_NULLPTR);
48 /**
49 * Destructor.
50 **/
51 virtual ~CategorySelectWidget();
53 /**
54 * Special @c Akonadi::Tag::Id values for filtering.
55 **/
56 enum FilterTag {
57 FilterAll = -2, /**< All items */
58 FilterUntagged = -3, /**< Untagged items */
59 FilterGroups = -4 /**< Contact groups */
62 /**
63 * Get the current tag filter list.
65 * @return The filter list, as would be sent by @c filterChanged()
67 * @see filterChanged
68 **/
69 QList<Akonadi::Tag::Id> filterTags() const;
71 Q_SIGNALS:
72 /**
73 * The tag filter selection has changed.
75 * @param idList A list of @c Akonadi::Tag::Id's of the tags which
76 * are to be included in the filter.
78 * @see CategorySelectModel::filterChanged
79 **/
80 void filterChanged(const QList<Akonadi::Tag::Id> &idList);
82 private:
83 CategorySelectWidgetPrivate *const d_ptr;
86 #endif // CATEGORYSELECTWIDGET_H