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 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
249 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
250 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
251 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
252 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
253 TDEAction *copyAction() {
return mCopyAction; }
254 TDEAction *selectAllAction() {
return mSelectAllAction; }
255 TDEAction *copyURLAction() {
return mCopyURLAction; }
256 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
257 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
258 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
259 TDEAction *startImChatAction() {
return mStartIMChatAction; }
264 void objectTreeToDecryptedMsg( partNode* node,
265 NewByteArray& resultingData,
267 bool weAreReplacingTheRootNode =
false,
273 partNode * partNodeForId(
int id );
275 KURL tempFileUrlFromPartNode(
const partNode * node );
280 void setUpdateAttachment(
bool update =
true ) { mAtmUpdate =
update; }
289 void openAttachment(
int id,
const TQString & name );
290 void saveAttachment(
const KURL &tempFileName );
292 void emitUrlClicked(
const KURL & url,
int button ) {
296 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
301 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
307 TQWidget* mainWindow() {
return mMainWindow; }
322 bool showAttachmentQuicklist()
const {
return mShowAttachmentQuicklist; }
325 void setShowAttachmentQuicklist(
bool showAttachmentQuicklist =
true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
329 bool showRawToltecMail()
const {
return mShowRawToltecMail; }
330 void setShowRawToltecMail(
bool showRawToltecMail ) { mShowRawToltecMail = showRawToltecMail; }
346 void clearBodyPartMementos();
375 void slotScrollDown();
376 void slotScrollPrior();
377 void slotScrollNext();
379 void slotDocumentChanged();
380 void slotDocumentDone();
381 void slotTextSelected(
bool);
385 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
391 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
404 void slotUrlClicked();
408 void slotMailtoCompose();
409 void slotMailtoForward();
410 void slotMailtoAddAddrBook();
411 void slotMailtoOpenAddrBook();
418 void slotAddBookmarks();
420 void slotSaveAttachments();
422 void slotMessageArrived(
KMMessage *msg );
425 void contactStatusChanged(
const TQString &uid);
427 void slotLevelQuote(
int l );
428 void slotTouchMessage();
439 void slotDeleteAttachment( partNode* node );
440 void slotEditAttachment( partNode* node );
442 KMail::CSSHelper* cssHelper();
445 void slotCycleHeaderStyles();
446 void slotBriefHeaders();
447 void slotFancyHeaders();
448 void slotEnterpriseHeaders();
449 void slotStandardHeaders();
450 void slotLongHeaders();
451 void slotAllHeaders();
453 void slotCycleAttachmentStrategy();
454 void slotIconicAttachments();
455 void slotSmartAttachments();
456 void slotInlineAttachments();
457 void slotHideAttachments();
458 void slotHeaderOnlyAttachments();
462 void slotDelayedResize();
463 void slotHandleAttachment(
int );
469 void msgAdded( TQListViewItem *item );
481 virtual bool event(TQEvent *e);
507 TQString
createTempDir(
const TQString ¶m = TQString() );
517 virtual void resizeEvent(TQResizeEvent *);
526 void slotSetEncoding();
527 void injectAttachments();
531 void createWidgets();
532 void createActions( TDEActionCollection * ac );
533 void saveSplitterSizes( TDEConfigBase & c )
const;
536 const KMail::HeaderStrategy * );
537 TDERadioAction * actionForAttachmentStrategy(
const KMail::AttachmentStrategy * );
539 void readGlobalOverrideCodec();
541 TQString renderAttachments( partNode *node,
const TQColor &bgColor );
544 bool mHtmlMail, mHtmlLoadExternal, mHtmlOverride, mHtmlLoadExtOverride;
546 TQString mAtmCurrentName;
550 unsigned long mSerNumOfOriginalMessage;
554 TQSplitter * mSplitter;
557 KMMimePartTree* mMimePartTree;
558 TDEHTMLPart *mViewer;
560 const KMail::AttachmentStrategy * mAttachmentStrategy;
561 const KMail::HeaderStrategy * mHeaderStrategy;
565 TQString mSaveAttachDir;
566 static const int delay;
567 TQTimer mUpdateReaderWinTimer;
568 TQTimer mResizeTimer;
569 TQTimer mDelayedMarkTimer;
570 TQTimer mHeaderRefreshTimer;
571 TQString mOverrideEncoding;
572 TQString mOldGlobalOverrideEncoding;
574 bool mNoMDNsWhenEncrypted;
575 unsigned long mLastSerNum;
577 KMail::CSSHelper * mCSSHelper;
582 TQStringList mTempFiles;
583 TQStringList mTempDirs;
585 bool mMimeTreeAtBottom;
586 TQValueList<int> mSplitterSizes;
588 TQString mIdOfLastViewedMessage;
589 TQWidget *mMainWindow;
590 TDEActionCollection *mActionCollection;
591 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
592 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
593 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
594 TDEToggleAction *mHeaderOnlyAttachmentsAction;
595 TDESelectAction *mSelectEncodingAction;
596 TDEToggleAction *mToggleFixFontAction;
600 TQPoint mLastClickPosition;
601 TQString mLastClickImagePath;
605 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
609 unsigned long mWaitingForSerNum;
610 float mSavedRelativePosition;
612 bool mDecrytMessageOverwrite;
613 bool mShowSignatureDetails;
614 bool mShowAttachmentQuicklist;
615 bool mShowRawToltecMail;
616 bool mExternalWindow;