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,
105 void writeConfig(
bool withSync=
true )
const;
113 const KMail::HeaderStrategy * strategy );
117 return mHeaderStrategy;
122 return mAttachmentStrategy;
124 void setAttachmentStrategy(
const KMail::AttachmentStrategy * strategy );
132 void setOverrideEncoding(
const TQString & encoding );
134 void setPrintFont(
const TQFont& font );
138 const TQTextCodec * overrideCodec()
const;
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 );
165 void setMsgPart( partNode * node );
169 void showHideMimeTree(
bool isPlainTextTopLevel );
176 { mIdOfLastViewedMessage = msgId; }
179 void clear(
bool force =
false) { setMsg(0, force); }
183 void saveRelativePosition();
186 void update(
bool force =
false);
189 virtual void printMsg(
void);
196 void setAutoDelete(
bool f) { mAutoDelete=f; }
200 void setHtmlOverride(
bool override );
210 void setHtmlLoadExtDefault(
bool loadExtDefault);
217 void setHtmlLoadExtOverride(
bool loadExtOverride);
223 bool htmlLoadExternal();
226 static TQString newFeaturesMD5();
229 void displaySplashPage(
const TQString &info );
232 void displayAboutPage();
235 void displayBusyPage();
237 void displayOfflinePage();
240 void enableMsgDisplay();
247 void atmViewMsg( KMMessagePart* msgPart,
int nodeId );
249 bool atBottom()
const;
251 bool isFixedFont() {
return mUseFixedFont; }
252 void setUseFixedFont(
bool useFixedFont ) { mUseFixedFont = useFixedFont; }
259 TDEToggleAction *toggleFixFontAction() {
return mToggleFixFontAction; }
260 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
261 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
262 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
263 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
264 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
265 TDEAction *copyAction() {
return mCopyAction; }
266 TDEAction *selectAllAction() {
return mSelectAllAction; }
267 TDEAction *copyURLAction() {
return mCopyURLAction; }
268 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
269 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
270 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
271 TDEAction *startImChatAction() {
return mStartIMChatAction; }
276 void objectTreeToDecryptedMsg( partNode* node,
277 NewByteArray& resultingData,
279 bool weAreReplacingTheRootNode =
false,
283 partNode* partNodeFromUrl(
const KURL &url);
285 partNode * partNodeForId(
int id );
287 KURL tempFileUrlFromPartNode(
const partNode * node );
290 static int msgPartFromUrl(
const KURL &url);
292 void setUpdateAttachment(
bool update =
true ) { mAtmUpdate = update; }
301 void openAttachment(
int id,
const TQString & name );
302 void saveAttachment(
const KURL &tempFileName );
304 void emitUrlClicked(
const KURL & url,
int button ) {
305 emit urlClicked( url, button );
308 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
310 emit popupMenu( *message(), url, p );
313 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
319 TQWidget* mainWindow() {
return mMainWindow; }
322 bool decryptMessage()
const;
334 bool showAttachmentQuicklist()
const {
return mShowAttachmentQuicklist; }
337 void setShowAttachmentQuicklist(
bool showAttachmentQuicklist =
true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
341 bool showRawToltecMail()
const {
return mShowRawToltecMail; }
342 void setShowRawToltecMail(
bool showRawToltecMail ) { mShowRawToltecMail = showRawToltecMail; }
353 void scrollToAttachment(
const partNode *node );
358 void clearBodyPartMementos();
363 void replaceMsgByUnencryptedVersion();
366 void popupMenu(
KMMessage &msg,
const KURL &url,
const TQPoint& mousePos);
369 void urlClicked(
const KURL &url,
int button);
383 void updateReaderWin();
387 void slotScrollDown();
388 void slotScrollPrior();
389 void slotScrollNext();
391 void slotDocumentChanged();
392 void slotDocumentDone();
393 void slotTextSelected(
bool);
397 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
400 void slotUrlOn(
const TQString &url);
403 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
411 void slotToggleFixedFont();
414 void slotCopySelectedText();
416 void slotUrlClicked();
419 void slotMailtoReply();
420 void slotMailtoCompose();
421 void slotMailtoForward();
422 void slotMailtoAddAddrBook();
423 void slotMailtoOpenAddrBook();
427 void slotUrlOpen(
const KURL &url = KURL() );
430 void slotAddBookmarks();
432 void slotSaveAttachments();
434 void slotMessageArrived(
KMMessage *msg );
437 void contactStatusChanged(
const TQString &uid);
439 void slotLevelQuote(
int l );
440 void slotTouchMessage();
449 void fillCommandInfo( partNode *node,
KMMessage **msg,
int *nodeId );
451 void slotDeleteAttachment( partNode* node );
452 void slotEditAttachment( partNode* node );
454 KMail::CSSHelper* cssHelper();
457 void slotCycleHeaderStyles();
458 void slotBriefHeaders();
459 void slotFancyHeaders();
460 void slotEnterpriseHeaders();
461 void slotStandardHeaders();
462 void slotLongHeaders();
463 void slotAllHeaders();
465 void slotCycleAttachmentStrategy();
466 void slotIconicAttachments();
467 void slotSmartAttachments();
468 void slotInlineAttachments();
469 void slotHideAttachments();
470 void slotHeaderOnlyAttachments();
473 void slotAtmView(
int id,
const TQString& name );
474 void slotDelayedResize();
475 void slotHandleAttachment(
int );
480 void disconnectMsgAdded();
481 void msgAdded( TQListViewItem *item );
486 void styleChange( TQStyle& oldStyle );
490 void setStyleDependantFrameWidth();
493 virtual bool event(TQEvent *e);
496 int pointsToPixel(
int pointSize)
const;
500 void displayMessage();
507 TQString writeMsgHeader(
KMMessage* aMsg, partNode *vCardNode = 0,
bool topLevel=
false );
512 TQString writeMessagePartToTempFile( KMMessagePart* msgPart,
int partNumber );
519 TQString createTempDir(
const TQString ¶m = TQString() );
522 void showVCard(KMMessagePart *msgPart);
525 virtual void initHtmlWidget(
void);
528 virtual void closeEvent(TQCloseEvent *);
529 virtual void resizeEvent(TQResizeEvent *);
532 virtual void removeTempFiles();
535 bool eventFilter( TQObject *obj, TQEvent *ev );
538 void slotSetEncoding();
539 void injectAttachments();
543 void createWidgets();
544 void createActions( TDEActionCollection * ac );
545 void saveSplitterSizes( TDEConfigBase & c )
const;
548 const KMail::HeaderStrategy * );
549 TDERadioAction * actionForAttachmentStrategy(
const KMail::AttachmentStrategy * );
551 void readGlobalOverrideCodec();
553 TQString renderAttachments( partNode *node,
const TQColor &bgColor );
556 bool mHtmlMail, mHtmlLoadExtDefault, mHtmlOverride, mHtmlLoadExtOverride;
558 TQString mAtmCurrentName;
562 unsigned long mSerNumOfOriginalMessage;
566 TQSplitter * mSplitter;
569 KMMimePartTree* mMimePartTree;
570 TDEHTMLPart *mViewer;
572 const KMail::AttachmentStrategy * mAttachmentStrategy;
573 const KMail::HeaderStrategy * mHeaderStrategy;
577 TQString mSaveAttachDir;
578 static const int delay;
579 TQTimer mUpdateReaderWinTimer;
580 TQTimer mResizeTimer;
581 TQTimer mDelayedMarkTimer;
582 TQTimer mHeaderRefreshTimer;
583 TQString mOverrideEncoding;
584 TQString mOldGlobalOverrideEncoding;
586 bool mNoMDNsWhenEncrypted;
587 unsigned long mLastSerNum;
589 KMail::CSSHelper * mCSSHelper;
594 TQStringList mTempFiles;
595 TQStringList mTempDirs;
597 bool mMimeTreeAtBottom;
598 TQValueList<int> mSplitterSizes;
600 TQString mIdOfLastViewedMessage;
601 TQWidget *mMainWindow;
602 TDEActionCollection *mActionCollection;
603 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
604 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
605 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
606 TDEToggleAction *mHeaderOnlyAttachmentsAction;
607 TDESelectAction *mSelectEncodingAction;
608 TDEToggleAction *mToggleFixFontAction;
612 TQPoint mLastClickPosition;
613 TQString mLastClickImagePath;
617 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
621 unsigned long mWaitingForSerNum;
622 float mSavedRelativePosition;
624 bool mDecrytMessageOverwrite;
625 bool mShowSignatureDetails;
626 bool mShowAttachmentQuicklist;
627 bool mShowRawToltecMail;
628 bool mExternalWindow;
bool autoDelete(void) const
Get/set auto-delete msg flag.
TDEHTMLPart * htmlPart() const
Access to the TDEHTMLPart used for the viewer.
This class implements a "reader window", that is a window used for reading or viewing messages...
bool showSignatureDetails() const
Show signature details.
virtual void setPrinting(bool enable)
Set printing mode.
An interface to HTML sinks.
const KMail::HeaderStrategy * headerStrategy() const
Getthe message header strategy.
void setDecryptMessageOverwrite(bool overwrite=true)
Enforce message decryption.
bool htmlLoadExtOverride() const
Get the load external references override setting.
const KMail::AttachmentStrategy * attachmentStrategy() const
Get/set the message attachment strategy.
void clear(bool force=false)
Clear the reader and discard the current message.
interface of classes that implement status for BodyPartFormatters.
bool htmlOverride() const
Override default html mail setting.
The HTML statusbar widget for use with the reader.
TQString overrideEncoding() const
Get selected override character encoding.
KMail::HtmlWriter * htmlWriter()
Return the HtmlWriter connected to the TDEHTMLPart we use.
void setIdOfLastViewedMessage(const TQString &msgId)
Store message id of last viewed message, normally no need to call this function directly, since correct value is set automatically in parseMsg(KMMessage* aMsg, bool onlyProcessHeaders).
void setWaitingForSerNum(unsigned long serNum)
Set the serial number of the message this reader window is currently waiting for. ...
void setShowSignatureDetails(bool showDetails=true)
Show signature details.