Merge "persistent color scheme selection"
[trojita.git] / src / Gui / ComposerAttachmentsList.h
blob17907581000a49416d4d08fd0756cc6c492678d4
1 /* Copyright (C) 2012 Thomas Lübking <thomas.luebking@gmail.com>
3 This file is part of the Trojita Qt IMAP e-mail client,
4 http://trojita.flaska.net/
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License as
8 published by the Free Software Foundation; either version 2 of
9 the License or (at your option) version 3 or any later version
10 accepted by the membership of KDE e.V. (or its successor approved
11 by the membership of KDE e.V.), which shall act as a proxy
12 defined in Section 14 of version 3 of the license.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #pragma once
25 #include <memory>
26 #include <QList>
27 #include <QListView>
28 #include <QUrl>
30 namespace Composer {
31 class MessageComposer;
34 /** @short
35 This class is used inside the ComposeWidget. @see GUI::ComposeWidget. It is positioned below
36 the "Attach" button at the right of the ComposeWidget. When an item is dropped inside it an
37 attachement is added to the @see Imap::Mailbox::MessageComposer model.
40 class QDropEvent;
42 class ComposerAttachmentsList : public QListView {
43 Q_OBJECT
44 public:
45 explicit ComposerAttachmentsList(QWidget *parent);
46 void setComposer(std::shared_ptr<Composer::MessageComposer> composer);
47 signals:
48 void itemDroppedOut();
49 protected:
50 void startDrag(Qt::DropActions da);
51 void dragEnterEvent(QDragEnterEvent *de);
52 void dragLeaveEvent(QDragLeaveEvent *de);
53 void dropEvent(QDropEvent* de);
54 public slots:
55 void slotRemoveAttachment();
56 void slotToggledContentDispositionInline(bool checked);
57 void slotRenameAttachment();
58 void onAttachmentNumberChanged();
59 void onCurrentChanged();
60 void showContextMenu(const QPoint &pos);
61 private:
62 bool m_dragging, m_dragInside;
63 std::shared_ptr<Composer::MessageComposer> m_composer;
64 QAction *m_actionRemoveAttachment;
65 QAction *m_actionSendInline;
66 QAction *m_actionRename;