1 /* Copyright (C) 2006 - 2012 Jan Kundrát <jkt@flaska.net>
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/>.
22 #ifndef VIEW_MESSAGEVIEW_H
23 #define VIEW_MESSAGEVIEW_H
25 #include <QPersistentModelIndex>
27 #include "Composer/Recipients.h"
40 class MsgPartNetAccessManager
;
52 class PartWidgetFactory
;
53 class ExternalElementsWidget
;
57 /** @short Widget for displaying complete e-mail messages as available from the IMAP server
59 Widget which can render a regular message as exported by the Imap::Mailbox::Model model.
60 Notably, this class will not render message/rfc822 MIME parts.
62 class MessageView
: public QWidget
66 explicit MessageView(QWidget
*parent
=0);
69 void reply(MainWindow
*mainWindow
, Composer::ReplyMode mode
);
70 QModelIndex
currentMessage() const;
72 void setMessage(const QModelIndex
&index
);
74 void setHomepageUrl(const QUrl
&homepage
);
76 void showEvent(QShowEvent
*se
);
79 void externalsRequested(const QUrl
&url
);
80 void externalsEnabled();
81 void linkInTitleHovered(const QString
&target
);
82 void newLabelAction(const QString
&tag
);
83 void deleteLabelAction(const QString
&tag
);
84 void handleDataChanged(const QModelIndex
&topLeft
, const QModelIndex
&bottomRight
);
85 void headerLinkActivated(QString
);
86 void partContextMenuRequested(const QPoint
&point
);
87 void partLinkHovered(const QString
&link
, const QString
&title
, const QString
&textContent
);
89 void messageChanged();
90 void linkHovered(const QString
&url
);
92 bool eventFilter(QObject
*object
, QEvent
*event
);
93 Imap::Message::Envelope
envelope() const;
95 QString
quoteText() const;
98 QWidget
*headerSection
;
100 ExternalElementsWidget
*externalElements
;
103 QPersistentModelIndex message
;
104 Imap::Network::MsgPartNetAccessManager
*netAccess
;
105 QTimer
*markAsReadTimer
;
107 PartWidgetFactory
*factory
;
109 MessageView(const MessageView
&); // don't implement
110 MessageView
&operator=(const MessageView
&); // don't implement
115 #endif // VIEW_MESSAGEVIEW_H