10 #include <tqstringlist.h>
13 #include "kmmsgbase.h"
14 #include "kmmimeparttree.h"
15 #include "interfaces/observer.h"
31 class KActionCollection;
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 KActionCollection *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 KToggleAction *toggleFixFontAction() {
return mToggleFixFontAction; }
248 KAction *mailToComposeAction() {
return mMailToComposeAction; }
249 KAction *mailToReplyAction() {
return mMailToReplyAction; }
250 KAction *mailToForwardAction() {
return mMailToForwardAction; }
251 KAction *addAddrBookAction() {
return mAddAddrBookAction; }
252 KAction *openAddrBookAction() {
return mOpenAddrBookAction; }
253 KAction *copyAction() {
return mCopyAction; }
254 KAction *selectAllAction() {
return mSelectAllAction; }
255 KAction *copyURLAction() {
return mCopyURLAction; }
256 KAction *urlOpenAction() {
return mUrlOpenAction; }
257 KAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
258 KAction *addBookmarksAction() {
return mAddBookmarksAction;}
259 KAction *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);
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( KActionCollection * ac );
532 void saveSplitterSizes( KConfigBase & c )
const;
535 const KMail::HeaderStrategy * );
536 KRadioAction * 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;
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 TQString mOverrideEncoding;
570 TQString mOldGlobalOverrideEncoding;
572 bool mNoMDNsWhenEncrypted;
573 unsigned long mLastSerNum;
575 KMail::CSSHelper * mCSSHelper;
580 TQStringList mTempFiles;
581 TQStringList mTempDirs;
583 bool mMimeTreeAtBottom;
584 TQValueList<int> mSplitterSizes;
586 TQString mIdOfLastViewedMessage;
587 TQWidget *mMainWindow;
588 KActionCollection *mActionCollection;
589 KAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
590 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
591 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
592 KToggleAction *mHeaderOnlyAttachmentsAction;
593 KSelectAction *mSelectEncodingAction;
594 KToggleAction *mToggleFixFontAction;
598 TQPoint mLastClickPosition;
599 TQString mLastClickImagePath;
603 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
607 unsigned long mWaitingForSerNum;
608 float mSavedRelativePosition;
610 bool mDecrytMessageOverwrite;
611 bool mShowSignatureDetails;
612 bool mShowAttachmentQuicklist;
613 bool mShowRawToltecMail;
614 bool mExternalWindow;