change KTTSD to Jovie
[kdepim.git] / kmail / kmreadermainwin.h
blob3c2922b66c85eec43dc8552e57465fffd1826022
1 // -*- mode: C++; c-file-style: "gnu" -*-
3 #ifndef KMReaderMainWin_h
4 #define KMReaderMainWin_h
6 #include "secondarywindow.h"
8 #include <kurl.h>
9 #include <KMime/Message>
11 #include <boost/scoped_ptr.hpp>
12 #include <akonadi/item.h>
13 class KMReaderWin;
14 class KAction;
15 class KFontAction;
16 class KFontSizeAction;
17 class KJob;
18 class CustomTemplatesMenu;
19 template <typename T, typename S> class QMap;
21 namespace KMail {
22 class MessageActions;
25 namespace KMime {
26 class Message;
27 class Content;
29 namespace Akonadi {
30 class Item;
33 class KMReaderMainWin : public KMail::SecondaryWindow
35 Q_OBJECT
37 public:
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 );
45 /**
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);
55 private slots:
56 void slotMessagePopup(const Akonadi::Item& ,const KUrl&,const QPoint& );
57 void slotDelayedMessagePopup( KJob* );
58 void slotTrashMsg();
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();
77 private:
78 void initKMReaderMainWin();
79 void setupAccel();
80 KAction *copyActionMenu();
81 void updateCustomTemplateMenus();
83 KMReaderWin *mReaderWin;
84 Akonadi::Item mMsg;
85 KUrl mUrl;
86 // a few actions duplicated from kmmainwidget
87 KAction *mTrashAction, *mPrintAction, *mSaveAsAction, *mSaveAtmAction,
88 *mViewSourceAction;
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*/