10 #include <tqstringlist.h>
13 #include "kmmsgbase.h"
14 #include "kmmimeparttree.h"
15 #include "interfaces/observer.h"
31 class TDEActionCollection;
34 class TDESelectAction;
36 class TDEToggleAction;
47 class BodyPartMemento;
50 class ObjectTreeParser;
51 class AttachmentStrategy;
55 class KHtmlPartHtmlWriter;
80 friend void KMMimePartTree::itemClicked( TQListViewItem* item );
81 friend void KMMimePartTree::itemRightClicked( TQListViewItem* item,
const TQPoint & );
82 friend void KMMimePartTree::slotSaveAs();
83 friend void KMMimePartTree::startDrag();
85 friend class KMail::ObjectTreeParser;
86 friend class KMail::KHtmlPartHtmlWriter;
91 TDEActionCollection *actionCollection,
114 const KMail::HeaderStrategy * strategy );
118 return mHeaderStrategy;
123 return mAttachmentStrategy;
125 void setAttachmentStrategy(
const KMail::AttachmentStrategy * strategy );
135 void setPrintFont(
const TQFont& font );
146 virtual void setMsg(
KMMessage* msg,
bool force =
false,
bool updateOnly =
false );
159 void setOriginalMsg(
unsigned long serNumOfOriginalMessage,
int nodeIdOffset );
163 void setMsgPart( KMMessagePart* aMsgPart,
bool aHTML,
164 const TQString& aFileName,
const TQString& pname );
177 { mIdOfLastViewedMessage = msgId; }
187 void update(
bool force =
false);
197 void setAutoDelete(
bool f) { mAutoDelete=f; }
201 void setHtmlOverride(
bool override );
205 void setHtmlLoadExtOverride(
bool override );
235 void atmViewMsg( KMMessagePart* msgPart,
int nodeId );
237 bool atBottom()
const;
239 bool isFixedFont() {
return mUseFixedFont; }
240 void setUseFixedFont(
bool useFixedFont ) { mUseFixedFont = useFixedFont; }
247 TDEToggleAction *toggleFixFontAction() {
return mToggleFixFontAction; }
248 TDEToggleAction *toggleMimePartTreeAction() {
return mToggleMimePartTreeAction; }
249 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
250 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
251 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
252 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
253 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
254 TDEAction *copyAction() {
return mCopyAction; }
255 TDEAction *selectAllAction() {
return mSelectAllAction; }
256 TDEAction *copyURLAction() {
return mCopyURLAction; }
257 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
258 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
259 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
260 TDEAction *startImChatAction() {
return mStartIMChatAction; }
265 void objectTreeToDecryptedMsg( partNode* node,
266 NewByteArray& resultingData,
268 bool weAreReplacingTheRootNode =
false,
274 partNode * partNodeForId(
int id );
276 KURL tempFileUrlFromPartNode(
const partNode * node );
281 void setUpdateAttachment(
bool update =
true ) { mAtmUpdate =
update; }
290 void openAttachment(
int id,
const TQString & name );
291 void saveAttachment(
const KURL &tempFileName );
293 void emitUrlClicked(
const KURL & url,
int button ) {
297 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
302 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
308 TQWidget* mainWindow() {
return mMainWindow; }
323 bool showAttachmentQuicklist()
const {
return mShowAttachmentQuicklist; }
326 void setShowAttachmentQuicklist(
bool showAttachmentQuicklist =
true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
330 bool showRawToltecMail()
const {
return mShowRawToltecMail; }
331 void setShowRawToltecMail(
bool showRawToltecMail ) { mShowRawToltecMail = showRawToltecMail; }
347 void clearBodyPartMementos();
376 void slotScrollDown();
377 void slotScrollPrior();
378 void slotScrollNext();
380 void slotDocumentChanged();
381 void slotDocumentDone();
382 void slotTextSelected(
bool);
386 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
392 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
408 void slotUrlClicked();
412 void slotMailtoCompose();
413 void slotMailtoForward();
414 void slotMailtoAddAddrBook();
415 void slotMailtoOpenAddrBook();
422 void slotAddBookmarks();
424 void slotSaveAttachments();
426 void slotMessageArrived(
KMMessage *msg );
429 void contactStatusChanged(
const TQString &uid);
431 void slotLevelQuote(
int l );
432 void slotTouchMessage();
443 void slotDeleteAttachment( partNode* node );
444 void slotEditAttachment( partNode* node );
446 KMail::CSSHelper* cssHelper();
449 void slotCycleHeaderStyles();
450 void slotBriefHeaders();
451 void slotFancyHeaders();
452 void slotEnterpriseHeaders();
453 void slotStandardHeaders();
454 void slotLongHeaders();
455 void slotAllHeaders();
457 void slotCycleAttachmentStrategy();
458 void slotIconicAttachments();
459 void slotSmartAttachments();
460 void slotInlineAttachments();
461 void slotHideAttachments();
462 void slotHeaderOnlyAttachments();
466 void slotDelayedResize();
467 void slotHandleAttachment(
int );
473 void msgAdded( TQListViewItem *item );
485 virtual bool event(TQEvent *e);
511 TQString
createTempDir(
const TQString ¶m = TQString() );
521 virtual void resizeEvent(TQResizeEvent *);
530 void slotSetEncoding();
531 void injectAttachments();
535 void createWidgets();
536 void createActions( TDEActionCollection * ac );
537 void saveSplitterSizes( TDEConfigBase & c )
const;
540 const KMail::HeaderStrategy * );
541 TDERadioAction * actionForAttachmentStrategy(
const KMail::AttachmentStrategy * );
543 void readGlobalOverrideCodec();
545 TQString renderAttachments( partNode *node,
const TQColor &bgColor );
548 bool mHtmlMail, mHtmlLoadExternal, mHtmlOverride, mHtmlLoadExtOverride;
550 TQString mAtmCurrentName;
554 unsigned long mSerNumOfOriginalMessage;
558 TQSplitter * mSplitter;
561 KMMimePartTree* mMimePartTree;
562 TDEHTMLPart *mViewer;
564 const KMail::AttachmentStrategy * mAttachmentStrategy;
565 const KMail::HeaderStrategy * mHeaderStrategy;
569 TQString mSaveAttachDir;
570 static const int delay;
571 TQTimer mUpdateReaderWinTimer;
572 TQTimer mResizeTimer;
573 TQTimer mDelayedMarkTimer;
574 TQTimer mHeaderRefreshTimer;
575 TQString mOverrideEncoding;
576 TQString mOldGlobalOverrideEncoding;
578 bool mNoMDNsWhenEncrypted;
579 unsigned long mLastSerNum;
581 KMail::CSSHelper * mCSSHelper;
586 TQStringList mTempFiles;
587 TQStringList mTempDirs;
589 int mMimeTreeModeOverride;
590 bool mMimeTreeAtBottom;
591 TQValueList<int> mSplitterSizes;
593 TQString mIdOfLastViewedMessage;
594 TQWidget *mMainWindow;
595 TDEActionCollection *mActionCollection;
596 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
597 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
598 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
599 TDEToggleAction *mHeaderOnlyAttachmentsAction;
600 TDESelectAction *mSelectEncodingAction;
601 TDEToggleAction *mToggleFixFontAction;
602 TDEToggleAction *mToggleMimePartTreeAction;
606 TQPoint mLastClickPosition;
607 TQString mLastClickImagePath;
611 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
615 unsigned long mWaitingForSerNum;
616 float mSavedRelativePosition;
618 bool mDecrytMessageOverwrite;
619 bool mShowSignatureDetails;
620 bool mShowAttachmentQuicklist;
621 bool mShowRawToltecMail;
622 bool mExternalWindow;