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/>.
31 class MessageComposer
;
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.
42 class ComposerAttachmentsList
: public QListView
{
45 explicit ComposerAttachmentsList(QWidget
*parent
);
46 void setComposer(std::shared_ptr
<Composer::MessageComposer
> composer
);
48 void itemDroppedOut();
50 void startDrag(Qt::DropActions da
);
51 void dragEnterEvent(QDragEnterEvent
*de
);
52 void dragLeaveEvent(QDragLeaveEvent
*de
);
53 void dropEvent(QDropEvent
* de
);
55 void slotRemoveAttachment();
56 void slotToggledContentDispositionInline(bool checked
);
57 void slotRenameAttachment();
58 void onAttachmentNumberChanged();
59 void onCurrentChanged();
60 void showContextMenu(const QPoint
&pos
);
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
;