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,
106 void writeConfig(
bool withSync=
true )
const;
114 const KMail::HeaderStrategy * strategy );
118 return mHeaderStrategy;
123 return mAttachmentStrategy;
125 void setAttachmentStrategy(
const KMail::AttachmentStrategy * strategy );
133 void setOverrideEncoding(
const TQString & encoding );
135 void setPrintFont(
const TQFont& font );
139 const TQTextCodec * overrideCodec()
const;
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 );
166 void setMsgPart( partNode * node );
170 void showHideMimeTree(
bool isPlainTextTopLevel );
177 { mIdOfLastViewedMessage = msgId; }
180 void clear(
bool force =
false) { setMsg(0, force); }
184 void saveRelativePosition();
187 void update(
bool force =
false);
190 virtual void printMsg(
void);
197 void setAutoDelete(
bool f) { mAutoDelete=f; }
201 void setHtmlOverride(
bool override );
205 void setHtmlLoadExtOverride(
bool override );
211 bool htmlLoadExternal();
214 static TQString newFeaturesMD5();
217 void displaySplashPage(
const TQString &info );
220 void displayAboutPage();
223 void displayBusyPage();
225 void displayOfflinePage();
228 void enableMsgDisplay();
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,
272 partNode* partNodeFromUrl(
const KURL &url);
274 partNode * partNodeForId(
int id );
276 KURL tempFileUrlFromPartNode(
const partNode * node );
279 static int msgPartFromUrl(
const KURL &url);
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 ) {
294 emit urlClicked( url, button );
297 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
299 emit popupMenu( *message(), url, p );
302 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
308 TQWidget* mainWindow() {
return mMainWindow; }
311 bool decryptMessage()
const;
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; }
342 void scrollToAttachment(
const partNode *node );
347 void clearBodyPartMementos();
352 void replaceMsgByUnencryptedVersion();
355 void popupMenu(
KMMessage &msg,
const KURL &url,
const TQPoint& mousePos);
358 void urlClicked(
const KURL &url,
int button);
372 void updateReaderWin();
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);
389 void slotUrlOn(
const TQString &url);
392 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
400 void slotToggleFixedFont();
403 void slotToggleMimePartTree();
406 void slotCopySelectedText();
408 void slotUrlClicked();
411 void slotMailtoReply();
412 void slotMailtoCompose();
413 void slotMailtoForward();
414 void slotMailtoAddAddrBook();
415 void slotMailtoOpenAddrBook();
419 void slotUrlOpen(
const KURL &url = KURL() );
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();
441 void fillCommandInfo( partNode *node,
KMMessage **msg,
int *nodeId );
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();
465 void slotAtmView(
int id,
const TQString& name );
466 void slotDelayedResize();
467 void slotHandleAttachment(
int );
472 void disconnectMsgAdded();
473 void msgAdded( TQListViewItem *item );
478 void styleChange( TQStyle& oldStyle );
482 void setStyleDependantFrameWidth();
485 virtual bool event(TQEvent *e);
488 int pointsToPixel(
int pointSize)
const;
492 void displayMessage();
499 TQString writeMsgHeader(
KMMessage* aMsg, partNode *vCardNode = 0,
bool topLevel=
false );
504 TQString writeMessagePartToTempFile( KMMessagePart* msgPart,
int partNumber );
511 TQString createTempDir(
const TQString ¶m = TQString() );
514 void showVCard(KMMessagePart *msgPart);
517 virtual void initHtmlWidget(
void);
520 virtual void closeEvent(TQCloseEvent *);
521 virtual void resizeEvent(TQResizeEvent *);
524 virtual void removeTempFiles();
527 bool eventFilter( TQObject *obj, TQEvent *ev );
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;
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
Override default load external references 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.