fix Messages.sh after yesterday change in extract-messages.sh
[kdepim.git] / kmail / attachmentview.h
blob1369f2936bfcd542dfd26ee918ce3f1a0ed45785
1 /*
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;
31 namespace Message {
32 class AttachmentModel;
35 namespace KMail {
37 class AttachmentView : public QTreeView
39 Q_OBJECT
41 public:
42 /// can't change model afterwards.
43 AttachmentView( Message::AttachmentModel *model, QWidget *parent = 0 );
44 ~AttachmentView();
46 /* reimpl */
47 virtual void contextMenuEvent( QContextMenuEvent *event );
48 /* reimpl */
49 virtual void keyPressEvent( QKeyEvent *event );
50 /** reimpl to avoid drags from ourselves */
51 virtual void dragEnterEvent( QDragEnterEvent *event );
53 public slots:
54 /// model sets these
55 void setEncryptEnabled( bool enabled );
56 void setSignEnabled( bool enabled );
57 void hideIfEmpty();
58 void selectNewAttachment();
60 protected:
61 /** reimpl to avoid default drag cursor */
62 virtual void startDrag( Qt::DropActions supportedActions );
64 signals:
65 void contextMenuRequested();
67 private:
68 class Private;
69 Private *const d;
72 } // namespace KMail
74 #endif // KMAIL_ATTACHMENTVIEW_H