3 #ifndef KMReaderMainWin_h
4 #define KMReaderMainWin_h
6 #include "secondarywindow.h"
9 #include <KMime/Message>
11 #include <AkonadiCore/item.h>
12 #include <AkonadiCore/collection.h>
13 #include <QModelIndex>
14 #include <messageviewer/viewer.h>
18 class KFontSizeAction
;
31 Q_DECLARE_METATYPE(QModelIndex
)
33 class KMReaderMainWin
: public KMail::SecondaryWindow
38 KMReaderMainWin(MessageViewer::Viewer::DisplayFormatMessage format
, bool htmlLoadExtOverride
, char *name
= Q_NULLPTR
);
39 explicit KMReaderMainWin(char *name
= Q_NULLPTR
);
40 KMReaderMainWin(KMime::Content
*aMsgPart
, MessageViewer::Viewer::DisplayFormatMessage format
, const QString
&encoding
, char *name
= Q_NULLPTR
);
41 virtual ~KMReaderMainWin();
43 void setUseFixedFont(bool useFixedFont
);
46 * take ownership of and show @param msg
48 * The last two parameters, serNumOfOriginalMessage and nodeIdOffset, are needed when @p msg
49 * is derived from another message, e.g. the user views an encapsulated message in this window.
50 * Then, the reader needs to know about that original message, so those to parameters are passed
51 * onto setOriginalMsg() of KMReaderWin.
53 void showMessage(const QString
&encoding
, const Akonadi::Item
&msg
, const Akonadi::Collection
&parentCollection
= Akonadi::Collection());
55 void showMessage(const QString
&encoding
, const KMime::Message::Ptr
&message
);
56 void showMessagePopup(const Akonadi::Item
&msg
, const QUrl
&aUrl
, const QUrl
&imageUrl
, const QPoint
&aPoint
, bool contactAlreadyExists
, bool uniqueContactFound
);
59 void slotMessagePopup(const Akonadi::Item
&, const QUrl
&, const QUrl
&imageUrl
, const QPoint
&);
60 void slotContactSearchJobForMessagePopupDone(KJob
*);
62 void slotForwardInlineMsg();
63 void slotForwardAttachedMsg();
64 void slotRedirectMsg();
65 void slotFontAction(const QString
&);
66 void slotSizeAction(int);
67 void slotCustomReplyToMsg(const QString
&tmpl
);
68 void slotCustomReplyAllToMsg(const QString
&tmpl
);
69 void slotCustomForwardMsg(const QString
&tmpl
);
71 void slotEditToolbars();
72 void slotConfigChanged();
73 void slotUpdateToolbars();
75 /// This closes the window if the setting to close the window after replying or
76 /// forwarding is set.
77 void slotReplyOrForwardFinished();
78 void slotCopyItem(QAction
*);
79 void slotCopyMoveResult(KJob
*job
);
80 void slotMoveItem(QAction
*action
);
83 void copyOrMoveItem(const Akonadi::Collection
&collection
, bool move
);
84 Akonadi::Collection
parentCollection() const;
85 void initKMReaderMainWin();
87 QAction
*copyActionMenu(QMenu
*menu
);
88 QAction
*moveActionMenu(QMenu
*menu
);
89 void changeFont(const QFont
&f
);
91 KMReaderWin
*mReaderWin
;
93 // a few actions duplicated from kmmainwidget
94 QAction
*mTrashAction
, *mSaveAtmAction
;
95 KFontAction
*mFontAction
;
96 KFontSizeAction
*mFontSizeAction
;
97 KMail::MessageActions
*mMsgActions
;
98 Akonadi::Collection mParentCollection
;
101 #endif /*KMReaderMainWin_h*/