File indexing completed on 2024-06-16 05:01:31

0001 /* Copyright (C) 2012 Mildred <mildred-pub@mildred.fr>
0002    Copyright (C) 2015 Erik Quaeghebeur <trojita@equaeghe.nospammail.net>
0003    Copyright (C) 2006 - 2015 Jan Kundrát <jkt@kde.org>
0004 
0005    This file is part of the Trojita Qt IMAP e-mail client,
0006    http://trojita.flaska.net/
0007 
0008    This program is free software; you can redistribute it and/or
0009    modify it under the terms of the GNU General Public License as
0010    published by the Free Software Foundation; either version 2 of
0011    the License or (at your option) version 3 or any later version
0012    accepted by the membership of KDE e.V. (or its successor approved
0013    by the membership of KDE e.V.), which shall act as a proxy
0014    defined in Section 14 of version 3 of the license.
0015 
0016    This program is distributed in the hope that it will be useful,
0017    but WITHOUT ANY WARRANTY; without even the implied warranty of
0018    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0019    GNU General Public License for more details.
0020 
0021    You should have received a copy of the GNU General Public License
0022    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0023 */
0024 
0025 #ifndef TAGLISTWIDGET_H
0026 #define TAGLISTWIDGET_H
0027 
0028 #include <QList>
0029 #include <QSet>
0030 #include <QWidget>
0031 #include "Imap/Model/FavoriteTagsModel.h"
0032 
0033 class QPushButton;
0034 
0035 namespace Gui
0036 {
0037 
0038 class FlowLayout;
0039 class TagWidget;
0040 
0041 class TagListWidget : public QWidget
0042 {
0043     Q_OBJECT
0044 public:
0045     explicit TagListWidget(QWidget *parent, Imap::Mailbox::FavoriteTagsModel *m_favoriteTags);
0046     void setTagList(QStringList list);
0047 
0048 signals:
0049     void tagAdded(QString tag);
0050     void tagRemoved(QString tag);
0051 
0052 private slots:
0053     void newTagsRequested();
0054 
0055 private:
0056     Imap::Mailbox::FavoriteTagsModel *m_favoriteTags;
0057 
0058     FlowLayout *parentLayout;
0059     TagWidget *addButton;
0060     QList<QObject *> children;
0061     QSet<QString> unsupportedReservedKeywords;
0062     void empty();
0063 };
0064 
0065 }
0066 
0067 #endif // TAGLISTWIDGET_H