SVN_SILENT made messages (.desktop file) - always resolve ours
[trojita.git] / src / Gui / MailBoxTreeView.h
blobe378e333333d38cd71c57d3ea25866ab392f25a5
1 /* Copyright (C) 2012 Thomas Gahr <thomas.gahr@physik.uni-muenchen.de>
2 Copyright (C) 2006 - 2016 Jan Kundrát <jkt@kde.org>
4 This file is part of the Trojita Qt IMAP e-mail client,
5 http://trojita.flaska.net/
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License as
9 published by the Free Software Foundation; either version 2 of
10 the License or (at your option) version 3 or any later version
11 accepted by the membership of KDE e.V. (or its successor approved
12 by the membership of KDE e.V.), which shall act as a proxy
13 defined in Section 14 of version 3 of the license.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>.
24 #ifndef GUI_MAILBOXTREEVIEW_H
25 #define GUI_MAILBOXTREEVIEW_H
27 #include <QSettings>
28 #include <QTreeView>
30 namespace Imap {
31 namespace Mailbox {
32 class MailboxFinder;
36 namespace Gui {
38 /** @short Show mailboxes in a tree view */
39 class MailBoxTreeView : public QTreeView
41 Q_OBJECT
42 public:
43 explicit MailBoxTreeView(QWidget *parent, QSettings *settings);
44 void setDesiredExpansion(const QStringList &mailboxNames);
45 void setModel(QAbstractItemModel *model) override;
46 signals:
47 /** @short User has changed their mind about the expanded/collapsed state of the mailbox tree
49 Stuff which gets reported here might refer to mailboxes which do not even exist. At the same time,
50 the code will not forget about those mailboxes which "aren't there yet".
52 void mailboxExpansionChanged(const QStringList &mailboxNames);
53 protected:
54 void dragMoveEvent(QDragMoveEvent *event) override;
55 void dropEvent(QDropEvent *event) override;
56 void dragEnterEvent(QDragEnterEvent *event) override;
57 void resetWatchedMailboxes();
58 Qt::DropAction defaultDropAction();
59 private:
60 Imap::Mailbox::MailboxFinder *m_mailboxFinder;
61 QSet<QString> m_desiredExpansionState;
62 QSettings *m_settings;
66 #endif // GUI_MAILBOXTREEVIEW_H