1 | /* |
2 | This file is part of Akonadi |
3 | |
4 | Copyright (c) 2014 Christian Mollekopf <mollekopf@kolabsys.com> |
5 | |
6 | This library is free software; you can redistribute it and/or modify it |
7 | under the terms of the GNU Library General Public License as published by |
8 | the Free Software Foundation; either version 2 of the License, or (at your |
9 | option) any later version. |
10 | |
11 | This library is distributed in the hope that it will be useful, but WITHOUT |
12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public |
14 | License for more details. |
15 | |
16 | You should have received a copy of the GNU Library General Public License |
17 | along with this library; see the file COPYING.LIB. If not, write to the |
18 | Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
19 | 02110-1301, USA. |
20 | */ |
21 | |
22 | #ifndef AKONADI_TAGEDITWIDGET_P_H |
23 | #define AKONADI_TAGEDITWIDGET_P_H |
24 | |
25 | #include <QWidget> |
26 | #include "akonadi/tag.h" |
27 | |
28 | namespace Akonadi { |
29 | |
30 | class TagModel; |
31 | /** |
32 | * A widget that offers facilities to add/remove tags and optionally provides a way to select tags. |
33 | * |
34 | * @since 4.13 |
35 | */ |
36 | class TagEditWidget : public QWidget |
37 | { |
38 | Q_OBJECT |
39 | public: |
40 | explicit TagEditWidget(Akonadi::TagModel *model, QWidget *parent = 0, bool enableSelection = false); |
41 | virtual ~TagEditWidget(); |
42 | |
43 | void setSelection(const Akonadi::Tag::List &tags); |
44 | Akonadi::Tag::List selection(); |
45 | |
46 | protected: |
47 | bool eventFilter(QObject *watched, QEvent *event); |
48 | |
49 | private: |
50 | class Private; |
51 | QSharedPointer<Private> d; |
52 | }; |
53 | |
54 | } |
55 | |
56 | #endif |
57 | |