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
20 #ifndef CATEGORYSELECTWIDGET_H
21 #define CATEGORYSELECTWIDGET_H
24 #include <AkonadiCore/tag.h>
26 class CategorySelectWidgetPrivate
;
29 * @short A widget to specify a category (tag) filter.
32 * @author Jonathan Marten
35 class CategorySelectWidget
: public QWidget
38 Q_DECLARE_PRIVATE(CategorySelectWidget
)
44 * @param parent The parent widget
46 explicit CategorySelectWidget(QWidget
*parent
= Q_NULLPTR
);
51 virtual ~CategorySelectWidget();
54 * Special @c Akonadi::Tag::Id values for filtering.
57 FilterAll
= -2, /**< All items */
58 FilterUntagged
= -3, /**< Untagged items */
59 FilterGroups
= -4 /**< Contact groups */
63 * Get the current tag filter list.
65 * @return The filter list, as would be sent by @c filterChanged()
69 QList
<Akonadi::Tag::Id
> filterTags() const;
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
80 void filterChanged(const QList
<Akonadi::Tag::Id
> &idList
);
83 CategorySelectWidgetPrivate
*const d_ptr
;
86 #endif // CATEGORYSELECTWIDGET_H