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 TDEToggleAction *toggleMimePartTreeAction() {
return mToggleMimePartTreeAction; }
261 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
262 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
263 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
264 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
265 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
266 TDEAction *copyAction() {
return mCopyAction; }
267 TDEAction *selectAllAction() {
return mSelectAllAction; }
268 TDEAction *copyURLAction() {
return mCopyURLAction; }
269 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
270 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
271 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
272 TDEAction *startImChatAction() {
return mStartIMChatAction; }
277 void objectTreeToDecryptedMsg( partNode* node,
278 NewByteArray& resultingData,
280 bool weAreReplacingTheRootNode =
false,
284 partNode* partNodeFromUrl(
const KURL &url);
286 partNode * partNodeForId(
int id );
288 KURL tempFileUrlFromPartNode(
const partNode * node );
291 static int msgPartFromUrl(
const KURL &url);
293 void setUpdateAttachment(
bool update =
true ) { mAtmUpdate = update; }
302 void openAttachment(
int id,
const TQString & name );
303 void saveAttachment(
const KURL &tempFileName );
305 void emitUrlClicked(
const KURL & url,
int button ) {
306 emit urlClicked( url, button );
309 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
311 emit popupMenu( *message(), url, p );
314 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
320 TQWidget* mainWindow() {
return mMainWindow; }
323 bool decryptMessage()
const;
335 bool showAttachmentQuicklist()
const {
return mShowAttachmentQuicklist; }
338 void setShowAttachmentQuicklist(
bool showAttachmentQuicklist =
true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
342 bool showRawToltecMail()
const {
return mShowRawToltecMail; }
343 void setShowRawToltecMail(
bool showRawToltecMail ) { mShowRawToltecMail = showRawToltecMail; }
354 void scrollToAttachment(
const partNode *node );
359 void clearBodyPartMementos();
364 void replaceMsgByUnencryptedVersion();
367 void popupMenu(
KMMessage &msg,
const KURL &url,
const TQPoint& mousePos);
370 void urlClicked(
const KURL &url,
int button);
384 void updateReaderWin();
388 void slotScrollDown();
389 void slotScrollPrior();
390 void slotScrollNext();
392 void slotDocumentChanged();
393 void slotDocumentDone();
394 void slotTextSelected(
bool);
398 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
401 void slotUrlOn(
const TQString &url);
404 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
412 void slotToggleFixedFont();
415 void slotToggleMimePartTree();
418 void slotCopySelectedText();
420 void slotUrlClicked();
423 void slotMailtoReply();
424 void slotMailtoCompose();
425 void slotMailtoForward();
426 void slotMailtoAddAddrBook();
427 void slotMailtoOpenAddrBook();
431 void slotUrlOpen(
const KURL &url = KURL() );
434 void slotAddBookmarks();
436 void slotSaveAttachments();
438 void slotMessageArrived(
KMMessage *msg );
441 void contactStatusChanged(
const TQString &uid);
443 void slotLevelQuote(
int l );
444 void slotTouchMessage();
453 void fillCommandInfo( partNode *node,
KMMessage **msg,
int *nodeId );
455 void slotDeleteAttachment( partNode* node );
456 void slotEditAttachment( partNode* node );
458 KMail::CSSHelper* cssHelper();
461 void slotCycleHeaderStyles();
462 void slotBriefHeaders();
463 void slotFancyHeaders();
464 void slotEnterpriseHeaders();
465 void slotStandardHeaders();
466 void slotLongHeaders();
467 void slotAllHeaders();
469 void slotCycleAttachmentStrategy();
470 void slotIconicAttachments();
471 void slotSmartAttachments();
472 void slotInlineAttachments();
473 void slotHideAttachments();
474 void slotHeaderOnlyAttachments();
477 void slotAtmView(
int id,
const TQString& name );
478 void slotDelayedResize();
479 void slotHandleAttachment(
int );
484 void disconnectMsgAdded();
485 void msgAdded( TQListViewItem *item );
490 void styleChange( TQStyle& oldStyle );
494 void setStyleDependantFrameWidth();
497 virtual bool event(TQEvent *e);
500 int pointsToPixel(
int pointSize)
const;
504 void displayMessage();
511 TQString writeMsgHeader(
KMMessage* aMsg, partNode *vCardNode = 0,
bool topLevel=
false );
516 TQString writeMessagePartToTempFile( KMMessagePart* msgPart,
int partNumber );
523 TQString createTempDir(
const TQString ¶m = TQString() );
526 void showVCard(KMMessagePart *msgPart);
529 virtual void initHtmlWidget(
void);
532 virtual void closeEvent(TQCloseEvent *);
533 virtual void resizeEvent(TQResizeEvent *);
536 virtual void removeTempFiles();
539 bool eventFilter( TQObject *obj, TQEvent *ev );
542 void slotSetEncoding();
543 void injectAttachments();
547 void createWidgets();
548 void createActions( TDEActionCollection * ac );
549 void saveSplitterSizes( TDEConfigBase & c )
const;
552 const KMail::HeaderStrategy * );
553 TDERadioAction * actionForAttachmentStrategy(
const KMail::AttachmentStrategy * );
555 void readGlobalOverrideCodec();
557 TQString renderAttachments( partNode *node,
const TQColor &bgColor );
560 bool mHtmlMail, mHtmlLoadExtDefault, mHtmlOverride, mHtmlLoadExtOverride;
562 TQString mAtmCurrentName;
566 unsigned long mSerNumOfOriginalMessage;
570 TQSplitter * mSplitter;
573 KMMimePartTree* mMimePartTree;
574 TDEHTMLPart *mViewer;
576 const KMail::AttachmentStrategy * mAttachmentStrategy;
577 const KMail::HeaderStrategy * mHeaderStrategy;
581 TQString mSaveAttachDir;
582 static const int delay;
583 TQTimer mUpdateReaderWinTimer;
584 TQTimer mResizeTimer;
585 TQTimer mDelayedMarkTimer;
586 TQTimer mHeaderRefreshTimer;
587 TQString mOverrideEncoding;
588 TQString mOldGlobalOverrideEncoding;
590 bool mNoMDNsWhenEncrypted;
591 unsigned long mLastSerNum;
593 KMail::CSSHelper * mCSSHelper;
598 TQStringList mTempFiles;
599 TQStringList mTempDirs;
601 int mMimeTreeModeOverride;
602 bool mMimeTreeAtBottom;
603 TQValueList<int> mSplitterSizes;
605 TQString mIdOfLastViewedMessage;
606 TQWidget *mMainWindow;
607 TDEActionCollection *mActionCollection;
608 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
609 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
610 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
611 TDEToggleAction *mHeaderOnlyAttachmentsAction;
612 TDESelectAction *mSelectEncodingAction;
613 TDEToggleAction *mToggleFixFontAction;
614 TDEToggleAction *mToggleMimePartTreeAction;
618 TQPoint mLastClickPosition;
619 TQString mLastClickImagePath;
623 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
627 unsigned long mWaitingForSerNum;
628 float mSavedRelativePosition;
630 bool mDecrytMessageOverwrite;
631 bool mShowSignatureDetails;
632 bool mShowAttachmentQuicklist;
633 bool mShowRawToltecMail;
634 bool mExternalWindow;
bool htmlOverride() const
Override default html mail setting.
This class implements a "reader window", that is a window used for reading or viewing messages...
virtual void setPrinting(bool enable)
Set printing mode.
bool showSignatureDetails() const
Show signature details.
An interface to HTML sinks.
const KMail::HeaderStrategy * headerStrategy() const
Getthe message header strategy.
void setDecryptMessageOverwrite(bool overwrite=true)
Enforce message decryption.
void clear(bool force=false)
Clear the reader and discard the current message.
interface of classes that implement status for BodyPartFormatters.
bool autoDelete(void) const
Get/set auto-delete msg flag.
bool htmlLoadExtOverride() const
Get the load external references override setting.
TQString overrideEncoding() const
Get selected override character encoding.
const KMail::AttachmentStrategy * attachmentStrategy() const
Get/set the message attachment strategy.
The HTML statusbar widget for use with the reader.
TDEHTMLPart * htmlPart() const
Access to the TDEHTMLPart used for the viewer.
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.