1/*
2 This file is part of Akonadi
3
4 Copyright (c) 2010 Tobias Koenig <tokoe@kde.org>
5 Copyright (c) 2014 Christian Mollekopf <mollekopf@kolabsys.com>
6
7 This library is free software; you can redistribute it and/or modify it
8 under the terms of the GNU Library General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or (at your
10 option) any later version.
11
12 This library is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
15 License for more details.
16
17 You should have received a copy of the GNU Library General Public License
18 along with this library; see the file COPYING.LIB. If not, write to the
19 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
20 02110-1301, USA.
21*/
22
23#ifndef AKONADI_TAGWIDGET_H
24#define AKONADI_TAGWIDGET_H
25
26#include "akonadi_export.h"
27
28#include <QWidget>
29#include "akonadi/tag.h"
30
31namespace Akonadi {
32
33/**
34 * A widget that shows a tag selection and provides means to edit that selection.
35 *
36 * TODO A standalone dialog version that takes an item and takes care of writing back the changes would be useful.
37 * @since 4.13
38 */
39class AKONADI_EXPORT TagWidget : public QWidget
40{
41 Q_OBJECT
42public:
43 explicit TagWidget(QWidget *parent = 0);
44 ~TagWidget();
45
46 void setSelection(const Akonadi::Tag::List &tags);
47 Akonadi::Tag::List selection() const;
48
49Q_SIGNALS:
50 void selectionChanged(const Akonadi::Tag::List &tags);
51
52private Q_SLOTS:
53 void editTags();
54
55private:
56 void updateView();
57
58private:
59 class Private;
60 QSharedPointer<Private> d;
61};
62
63}
64
65#endif
66