1 // -*- mode: C++; c-file-style: "gnu" -*-
3 #ifndef KMReaderMainWin_h
4 #define KMReaderMainWin_h
6 #include "secondarywindow.h"
9 #include <KMime/Message>
11 #include <boost/scoped_ptr.hpp>
12 #include <akonadi/item.h>
16 class KFontSizeAction
;
18 class CustomTemplatesMenu
;
19 template <typename T
, typename S
> class QMap
;
33 class KMReaderMainWin
: public KMail::SecondaryWindow
38 KMReaderMainWin( bool htmlOverride
, bool htmlLoadExtOverride
, char *name
= 0 );
39 KMReaderMainWin( char *name
= 0 );
40 KMReaderMainWin( KMime::Content
* aMsgPart
, bool aHTML
, const QString
&encoding
, char *name
= 0 );
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
);
54 void showMessage( const QString
& encoding
, KMime::Message::Ptr message
);
56 void slotMessagePopup(const Akonadi::Item
& ,const KUrl
&,const QPoint
& );
57 void slotDelayedMessagePopup( KJob
* );
59 void slotForwardInlineMsg();
60 void slotForwardAttachedMsg();
61 void slotRedirectMsg();
62 void slotFontAction(const QString
&);
63 void slotSizeAction(int);
64 void slotCreateTodo();
65 void slotCustomReplyToMsg( const QString
&tmpl
);
66 void slotCustomReplyAllToMsg( const QString
&tmpl
);
67 void slotCustomForwardMsg( const QString
&tmpl
);
69 void slotEditToolbars();
70 void slotConfigChanged();
71 void slotUpdateToolbars();
73 /// This closes the window if the setting to close the window after replying or
74 /// forwarding is set.
75 void slotReplyOrForwardFinished();
78 void initKMReaderMainWin();
80 KAction
*copyActionMenu();
81 void updateCustomTemplateMenus();
83 KMReaderWin
*mReaderWin
;
86 // a few actions duplicated from kmmainwidget
87 KAction
*mTrashAction
, *mPrintAction
, *mSaveAsAction
, *mSaveAtmAction
,
89 KFontAction
*fontAction
;
90 KFontSizeAction
*fontSizeAction
;
91 KMail::MessageActions
*mMsgActions
;
93 // Custom template actions menu
94 boost::scoped_ptr
<CustomTemplatesMenu
> mCustomTemplateMenus
;
97 #endif /*KMReaderMainWin_h*/