SVN_SILENT made messages (after extraction)
[kdepim.git] / kmail / kmreadermainwin.h
blob6ffb44595abece8a4b5ea358157292d146f218be
1 //
3 #ifndef KMReaderMainWin_h
4 #define KMReaderMainWin_h
6 #include "kmail_export.h"
7 #include "config-kdepim.h"
9 #include "secondarywindow.h"
11 #include <QUrl>
12 #include <KMime/Message>
14 #include <AkonadiCore/item.h>
15 #include <AkonadiCore/collection.h>
16 #include <QModelIndex>
17 #include <messageviewer/viewer.h>
18 class KMReaderWin;
19 class QAction;
20 class KJob;
22 namespace KMail
24 class MessageActions;
27 namespace KMime
29 class Message;
30 class Content;
32 Q_DECLARE_METATYPE(QModelIndex)
34 class KMAIL_EXPORT KMReaderMainWin : public KMail::SecondaryWindow
36 Q_OBJECT
38 public:
39 KMReaderMainWin(MessageViewer::Viewer::DisplayFormatMessage format, bool htmlLoadExtOverride, char *name = Q_NULLPTR);
40 explicit KMReaderMainWin(char *name = Q_NULLPTR);
41 KMReaderMainWin(KMime::Content *aMsgPart, MessageViewer::Viewer::DisplayFormatMessage format, const QString &encoding, char *name = Q_NULLPTR);
42 virtual ~KMReaderMainWin();
44 void setUseFixedFont(bool useFixedFont);
46 /**
47 * take ownership of and show @param msg
49 * The last two parameters, serNumOfOriginalMessage and nodeIdOffset, are needed when @p msg
50 * is derived from another message, e.g. the user views an encapsulated message in this window.
51 * Then, the reader needs to know about that original message, so those to parameters are passed
52 * onto setOriginalMsg() of KMReaderWin.
54 void showMessage(const QString &encoding, const Akonadi::Item &msg, const Akonadi::Collection &parentCollection = Akonadi::Collection());
56 void showMessage(const QString &encoding, const KMime::Message::Ptr &message);
57 void showMessagePopup(const Akonadi::Item &msg, const QUrl &aUrl, const QUrl &imageUrl, const QPoint &aPoint, bool contactAlreadyExists, bool uniqueContactFound);
59 private Q_SLOTS:
60 #ifdef QTWEBENGINE_SUPPORT_OPTION
61 void slotMessagePopup(const Akonadi::Item &aMsg, const WebEngineViewer::WebHitTestResult &result, const QPoint &aPoint);
62 #else
63 void slotMessagePopup(const Akonadi::Item &aMsg, const QUrl &aUrl, const QUrl &imageUrl, const QPoint &aPoint);
64 #endif
65 void slotContactSearchJobForMessagePopupDone(KJob *);
66 void slotExecuteMailAction(MessageViewer::Viewer::MailAction action);
67 void slotTrashMessage();
68 void slotForwardInlineMsg();
69 void slotForwardAttachedMessage();
70 void slotRedirectMessage();
71 void slotCustomReplyToMsg(const QString &tmpl);
72 void slotCustomReplyAllToMsg(const QString &tmpl);
73 void slotCustomForwardMsg(const QString &tmpl);
75 void slotEditToolbars();
76 void slotConfigChanged();
77 void slotUpdateToolbars();
79 /// This closes the window if the setting to close the window after replying or
80 /// forwarding is set.
81 void slotReplyOrForwardFinished();
82 void slotCopyItem(QAction *);
83 void slotCopyMoveResult(KJob *job);
84 void slotMoveItem(QAction *action);
86 private:
87 void copyOrMoveItem(const Akonadi::Collection &collection, bool move);
88 Akonadi::Collection parentCollection() const;
89 void initKMReaderMainWin();
90 void setupAccel();
91 QAction *copyActionMenu(QMenu *menu);
92 QAction *moveActionMenu(QMenu *menu);
94 KMReaderWin *mReaderWin;
95 Akonadi::Item mMsg;
96 // a few actions duplicated from kmmainwidget
97 QAction *mTrashAction, *mSaveAtmAction;
98 KMail::MessageActions *mMsgActions;
99 Akonadi::Collection mParentCollection;
102 #endif /*KMReaderMainWin_h*/