Better wording
[kdepim.git] / kmail / attachmentview.h
blobf5dadb2dd0893e0752456e78b4c389dc997d189e
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 explicit AttachmentView( Message::AttachmentModel *model, QWidget *parent = 0 );
44 ~AttachmentView();
46 public slots:
47 /// model sets these
48 void setEncryptEnabled( bool enabled );
49 void setSignEnabled( bool enabled );
50 void hideIfEmpty();
51 void selectNewAttachment();
53 protected:
54 /** reimpl to avoid default drag cursor */
55 virtual void startDrag( Qt::DropActions supportedActions );
56 /* reimpl */
57 virtual void contextMenuEvent( QContextMenuEvent *event );
58 /* reimpl */
59 virtual void keyPressEvent( QKeyEvent *event );
60 /** reimpl to avoid drags from ourselves */
61 virtual void dragEnterEvent( QDragEnterEvent *event );
63 private:
64 void saveHeaderState();
65 void restoreHeaderState();
67 signals:
68 void contextMenuRequested();
70 private:
71 class Private;
72 Private *const d;
75 } // namespace KMail
77 #endif // KMAIL_ATTACHMENTVIEW_H