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 explicit AttachmentView( Message::AttachmentModel
*model
, QWidget
*parent
= 0 );
48 void setEncryptEnabled( bool enabled
);
49 void setSignEnabled( bool enabled
);
51 void selectNewAttachment();
54 /** reimpl to avoid default drag cursor */
55 virtual void startDrag( Qt::DropActions supportedActions
);
57 virtual void contextMenuEvent( QContextMenuEvent
*event
);
59 virtual void keyPressEvent( QKeyEvent
*event
);
60 /** reimpl to avoid drags from ourselves */
61 virtual void dragEnterEvent( QDragEnterEvent
*event
);
64 void saveHeaderState();
65 void restoreHeaderState();
68 void contextMenuRequested();
77 #endif // KMAIL_ATTACHMENTVIEW_H