2 * This file is part of KMail.
3 * Copyright (c) 2009 Constantin Berzan <exit3219@gmail.com>
5 * Parts based on KMail code by:
6 * Copyright (c) 2003 Ingo Kloecker <kloecker@kde.org>
7 * Copyright (c) 2007 Thomas McGuire <Thomas.McGuire@gmx.net>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
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 along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef KMAIL_ATTACHMENTVIEW_H
25 #define KMAIL_ATTACHMENTVIEW_H
27 #include <QtGui/QTreeView>
29 class QContextMenuEvent
;
32 class AttachmentModel
;
37 class AttachmentView
: public QTreeView
42 /// can't change model afterwards.
43 AttachmentView( Message::AttachmentModel
*model
, QWidget
*parent
= 0 );
47 virtual void contextMenuEvent( QContextMenuEvent
*event
);
49 virtual void keyPressEvent( QKeyEvent
*event
);
50 /** reimpl to avoid drags from ourselves */
51 virtual void dragEnterEvent( QDragEnterEvent
*event
);
55 void setEncryptEnabled( bool enabled
);
56 void setSignEnabled( bool enabled
);
58 void selectNewAttachment();
61 /** reimpl to avoid default drag cursor */
62 virtual void startDrag( Qt::DropActions supportedActions
);
65 void contextMenuRequested();
74 #endif // KMAIL_ATTACHMENTVIEW_H