9 #include <tqstringlist.h>
12 #include "kmmsgbase.h"
13 #include "kmmimeparttree.h"
14 #include "interfaces/observer.h"
30 class TDEActionCollection;
33 class TDESelectAction;
35 class TDEToggleAction;
46 class BodyPartMemento;
49 class ObjectTreeParser;
50 class AttachmentStrategy;
54 class KHtmlPartHtmlWriter;
79 friend void KMMimePartTree::itemClicked( TQListViewItem* item );
80 friend void KMMimePartTree::itemRightClicked( TQListViewItem* item,
const TQPoint & );
81 friend void KMMimePartTree::slotSaveAs();
82 friend void KMMimePartTree::startDrag();
84 friend class KMail::ObjectTreeParser;
85 friend class KMail::KHtmlPartHtmlWriter;
90 TDEActionCollection *actionCollection,
113 const KMail::HeaderStrategy * strategy );
117 return mHeaderStrategy;
122 return mAttachmentStrategy;
124 void setAttachmentStrategy(
const KMail::AttachmentStrategy * strategy );
134 void setPrintFont(
const TQFont& font );
145 virtual void setMsg(
KMMessage* msg,
bool force =
false,
bool updateOnly =
false );
158 void setOriginalMsg(
unsigned long serNumOfOriginalMessage,
int nodeIdOffset );
162 void setMsgPart( KMMessagePart* aMsgPart,
bool aHTML,
163 const TQString& aFileName,
const TQString& pname );
176 { mIdOfLastViewedMessage = msgId; }
186 void update(
bool force =
false);
196 void setAutoDelete(
bool f) { mAutoDelete=f; }
200 void setHtmlOverride(
bool override );
204 void setHtmlLoadExtOverride(
bool override );
234 void atmViewMsg( KMMessagePart* msgPart,
int nodeId );
236 bool atBottom()
const;
238 bool isFixedFont() {
return mUseFixedFont; }
239 void setUseFixedFont(
bool useFixedFont ) { mUseFixedFont = useFixedFont; }
246 TDEToggleAction *toggleFixFontAction() {
return mToggleFixFontAction; }
247 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
248 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
249 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
250 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
251 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
252 TDEAction *copyAction() {
return mCopyAction; }
253 TDEAction *selectAllAction() {
return mSelectAllAction; }
254 TDEAction *copyURLAction() {
return mCopyURLAction; }
255 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
256 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
257 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
258 TDEAction *startImChatAction() {
return mStartIMChatAction; }
263 void objectTreeToDecryptedMsg( partNode* node,
264 NewByteArray& resultingData,
266 bool weAreReplacingTheRootNode =
false,
272 partNode * partNodeForId(
int id );
274 KURL tempFileUrlFromPartNode(
const partNode * node );
279 void setUpdateAttachment(
bool update =
true ) { mAtmUpdate =
update; }
288 void openAttachment(
int id,
const TQString & name );
289 void saveAttachment(
const KURL &tempFileName );
291 void emitUrlClicked(
const KURL & url,
int button ) {
295 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
300 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
306 TQWidget* mainWindow() {
return mMainWindow; }
321 bool showAttachmentQuicklist()
const {
return mShowAttachmentQuicklist; }
324 void setShowAttachmentQuicklist(
bool showAttachmentQuicklist =
true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
328 bool showRawToltecMail()
const {
return mShowRawToltecMail; }
329 void setShowRawToltecMail(
bool showRawToltecMail ) { mShowRawToltecMail = showRawToltecMail; }
345 void clearBodyPartMementos();
374 void slotScrollDown();
375 void slotScrollPrior();
376 void slotScrollNext();
378 void slotDocumentChanged();
379 void slotDocumentDone();
380 void slotTextSelected(
bool);
384 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
390 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
403 void slotUrlClicked();
407 void slotMailtoCompose();
408 void slotMailtoForward();
409 void slotMailtoAddAddrBook();
410 void slotMailtoOpenAddrBook();
417 void slotAddBookmarks();
419 void slotSaveAttachments();
421 void slotMessageArrived(
KMMessage *msg );
424 void contactStatusChanged(
const TQString &uid);
426 void slotLevelQuote(
int l );
427 void slotTouchMessage();
438 void slotDeleteAttachment( partNode* node );
439 void slotEditAttachment( partNode* node );
441 KMail::CSSHelper* cssHelper();
444 void slotCycleHeaderStyles();
445 void slotBriefHeaders();
446 void slotFancyHeaders();
447 void slotEnterpriseHeaders();
448 void slotStandardHeaders();
449 void slotLongHeaders();
450 void slotAllHeaders();
452 void slotCycleAttachmentStrategy();
453 void slotIconicAttachments();
454 void slotSmartAttachments();
455 void slotInlineAttachments();
456 void slotHideAttachments();
457 void slotHeaderOnlyAttachments();
461 void slotDelayedResize();
462 void slotHandleAttachment(
int );
468 void msgAdded( TQListViewItem *item );
480 virtual bool event(TQEvent *e);
506 TQString
createTempDir(
const TQString ¶m = TQString() );
516 virtual void resizeEvent(TQResizeEvent *);
525 void slotSetEncoding();
526 void injectAttachments();
530 void createWidgets();
531 void createActions( TDEActionCollection * ac );
532 void saveSplitterSizes( TDEConfigBase & c )
const;
535 const KMail::HeaderStrategy * );
536 TDERadioAction * actionForAttachmentStrategy(
const KMail::AttachmentStrategy * );
538 void readGlobalOverrideCodec();
540 TQString renderAttachments( partNode *node,
const TQColor &bgColor );
543 bool mHtmlMail, mHtmlLoadExternal, mHtmlOverride, mHtmlLoadExtOverride;
545 TQString mAtmCurrentName;
549 unsigned long mSerNumOfOriginalMessage;
553 TQSplitter * mSplitter;
556 KMMimePartTree* mMimePartTree;
557 TDEHTMLPart *mViewer;
559 const KMail::AttachmentStrategy * mAttachmentStrategy;
560 const KMail::HeaderStrategy * mHeaderStrategy;
564 TQString mSaveAttachDir;
565 static const int delay;
566 TQTimer mUpdateReaderWinTimer;
567 TQTimer mResizeTimer;
568 TQTimer mDelayedMarkTimer;
569 TQTimer mHeaderRefreshTimer;
570 TQString mOverrideEncoding;
571 TQString mOldGlobalOverrideEncoding;
573 bool mNoMDNsWhenEncrypted;
574 unsigned long mLastSerNum;
576 KMail::CSSHelper * mCSSHelper;
581 TQStringList mTempFiles;
582 TQStringList mTempDirs;
584 bool mMimeTreeAtBottom;
585 TQValueList<int> mSplitterSizes;
587 TQString mIdOfLastViewedMessage;
588 TQWidget *mMainWindow;
589 TDEActionCollection *mActionCollection;
590 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
591 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
592 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
593 TDEToggleAction *mHeaderOnlyAttachmentsAction;
594 TDESelectAction *mSelectEncodingAction;
595 TDEToggleAction *mToggleFixFontAction;
599 TQPoint mLastClickPosition;
600 TQString mLastClickImagePath;
604 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
608 unsigned long mWaitingForSerNum;
609 float mSavedRelativePosition;
611 bool mDecrytMessageOverwrite;
612 bool mShowSignatureDetails;
613 bool mShowAttachmentQuicklist;
614 bool mShowRawToltecMail;
615 bool mExternalWindow;