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 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
249 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
250 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
251 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
252 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
253 TDEAction *copyAction() {
return mCopyAction; }
254 TDEAction *selectAllAction() {
return mSelectAllAction; }
255 TDEAction *copyURLAction() {
return mCopyURLAction; }
256 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
257 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
258 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
259 TDEAction *startImChatAction() {
return mStartIMChatAction; }
264 void objectTreeToDecryptedMsg( partNode* node,
265 NewByteArray& resultingData,
267 bool weAreReplacingTheRootNode =
false,
271 partNode* partNodeFromUrl(
const KURL &url);
273 partNode * partNodeForId(
int id );
275 KURL tempFileUrlFromPartNode(
const partNode * node );
278 static int msgPartFromUrl(
const KURL &url);
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 ) {
293 emit urlClicked( url, button );
296 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
298 emit popupMenu( *message(), url, p );
301 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
307 TQWidget* mainWindow() {
return mMainWindow; }
310 bool decryptMessage()
const;
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; }
341 void scrollToAttachment(
const partNode *node );
346 void clearBodyPartMementos();
351 void replaceMsgByUnencryptedVersion();
354 void popupMenu(
KMMessage &msg,
const KURL &url,
const TQPoint& mousePos);
357 void urlClicked(
const KURL &url,
int button);
371 void updateReaderWin();
375 void slotScrollDown();
376 void slotScrollPrior();
377 void slotScrollNext();
379 void slotDocumentChanged();
380 void slotDocumentDone();
381 void slotTextSelected(
bool);
385 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
388 void slotUrlOn(
const TQString &url);
391 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
399 void slotToggleFixedFont();
402 void slotCopySelectedText();
404 void slotUrlClicked();
407 void slotMailtoReply();
408 void slotMailtoCompose();
409 void slotMailtoForward();
410 void slotMailtoAddAddrBook();
411 void slotMailtoOpenAddrBook();
415 void slotUrlOpen(
const KURL &url = KURL() );
418 void slotAddBookmarks();
420 void slotSaveAttachments();
422 void slotMessageArrived(
KMMessage *msg );
425 void contactStatusChanged(
const TQString &uid);
427 void slotLevelQuote(
int l );
428 void slotTouchMessage();
437 void fillCommandInfo( partNode *node,
KMMessage **msg,
int *nodeId );
439 void slotDeleteAttachment( partNode* node );
440 void slotEditAttachment( partNode* node );
442 KMail::CSSHelper* cssHelper();
445 void slotCycleHeaderStyles();
446 void slotBriefHeaders();
447 void slotFancyHeaders();
448 void slotEnterpriseHeaders();
449 void slotStandardHeaders();
450 void slotLongHeaders();
451 void slotAllHeaders();
453 void slotCycleAttachmentStrategy();
454 void slotIconicAttachments();
455 void slotSmartAttachments();
456 void slotInlineAttachments();
457 void slotHideAttachments();
458 void slotHeaderOnlyAttachments();
461 void slotAtmView(
int id,
const TQString& name );
462 void slotDelayedResize();
463 void slotHandleAttachment(
int );
468 void disconnectMsgAdded();
469 void msgAdded( TQListViewItem *item );
474 void styleChange( TQStyle& oldStyle );
478 void setStyleDependantFrameWidth();
481 virtual bool event(TQEvent *e);
484 int pointsToPixel(
int pointSize)
const;
488 void displayMessage();
495 TQString writeMsgHeader(
KMMessage* aMsg, partNode *vCardNode = 0,
bool topLevel=
false );
500 TQString writeMessagePartToTempFile( KMMessagePart* msgPart,
int partNumber );
507 TQString createTempDir(
const TQString ¶m = TQString() );
510 void showVCard(KMMessagePart *msgPart);
513 virtual void initHtmlWidget(
void);
516 virtual void closeEvent(TQCloseEvent *);
517 virtual void resizeEvent(TQResizeEvent *);
520 virtual void removeTempFiles();
523 bool eventFilter( TQObject *obj, TQEvent *ev );
526 void slotSetEncoding();
527 void injectAttachments();
531 void createWidgets();
532 void createActions( TDEActionCollection * ac );
533 void saveSplitterSizes( TDEConfigBase & c )
const;
536 const KMail::HeaderStrategy * );
537 TDERadioAction * actionForAttachmentStrategy(
const KMail::AttachmentStrategy * );
539 void readGlobalOverrideCodec();
541 TQString renderAttachments( partNode *node,
const TQColor &bgColor );
544 bool mHtmlMail, mHtmlLoadExternal, mHtmlOverride, mHtmlLoadExtOverride;
546 TQString mAtmCurrentName;
550 unsigned long mSerNumOfOriginalMessage;
554 TQSplitter * mSplitter;
557 KMMimePartTree* mMimePartTree;
558 TDEHTMLPart *mViewer;
560 const KMail::AttachmentStrategy * mAttachmentStrategy;
561 const KMail::HeaderStrategy * mHeaderStrategy;
565 TQString mSaveAttachDir;
566 static const int delay;
567 TQTimer mUpdateReaderWinTimer;
568 TQTimer mResizeTimer;
569 TQTimer mDelayedMarkTimer;
570 TQTimer mHeaderRefreshTimer;
571 TQString mOverrideEncoding;
572 TQString mOldGlobalOverrideEncoding;
574 bool mNoMDNsWhenEncrypted;
575 unsigned long mLastSerNum;
577 KMail::CSSHelper * mCSSHelper;
582 TQStringList mTempFiles;
583 TQStringList mTempDirs;
585 bool mMimeTreeAtBottom;
586 TQValueList<int> mSplitterSizes;
588 TQString mIdOfLastViewedMessage;
589 TQWidget *mMainWindow;
590 TDEActionCollection *mActionCollection;
591 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
592 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
593 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
594 TDEToggleAction *mHeaderOnlyAttachmentsAction;
595 TDESelectAction *mSelectEncodingAction;
596 TDEToggleAction *mToggleFixFontAction;
600 TQPoint mLastClickPosition;
601 TQString mLastClickImagePath;
605 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
609 unsigned long mWaitingForSerNum;
610 float mSavedRelativePosition;
612 bool mDecrytMessageOverwrite;
613 bool mShowSignatureDetails;
614 bool mShowAttachmentQuicklist;
615 bool mShowRawToltecMail;
616 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
Override default load external references 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.