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 );
204 void setHtmlLoadExtOverride(
bool override );
210 bool htmlLoadExternal();
213 static TQString newFeaturesMD5();
216 void displaySplashPage(
const TQString &info );
219 void displayAboutPage();
222 void displayBusyPage();
224 void displayOfflinePage();
227 void enableMsgDisplay();
234 void atmViewMsg( KMMessagePart* msgPart,
int nodeId );
236 bool atBottom()
const;
238 bool isFixedFont() {
return mUseFixedFont; }
239 void setUseFixedFont(
bool useFixedFont ) { mUseFixedFont = useFixedFont; }
246 TDEToggleAction *toggleFixFontAction() {
return mToggleFixFontAction; }
247 TDEAction *mailToComposeAction() {
return mMailToComposeAction; }
248 TDEAction *mailToReplyAction() {
return mMailToReplyAction; }
249 TDEAction *mailToForwardAction() {
return mMailToForwardAction; }
250 TDEAction *addAddrBookAction() {
return mAddAddrBookAction; }
251 TDEAction *openAddrBookAction() {
return mOpenAddrBookAction; }
252 TDEAction *copyAction() {
return mCopyAction; }
253 TDEAction *selectAllAction() {
return mSelectAllAction; }
254 TDEAction *copyURLAction() {
return mCopyURLAction; }
255 TDEAction *urlOpenAction() {
return mUrlOpenAction; }
256 TDEAction *urlSaveAsAction() {
return mUrlSaveAsAction; }
257 TDEAction *addBookmarksAction() {
return mAddBookmarksAction;}
258 TDEAction *startImChatAction() {
return mStartIMChatAction; }
263 void objectTreeToDecryptedMsg( partNode* node,
264 NewByteArray& resultingData,
266 bool weAreReplacingTheRootNode =
false,
270 partNode* partNodeFromUrl(
const KURL &url);
272 partNode * partNodeForId(
int id );
274 KURL tempFileUrlFromPartNode(
const partNode * node );
277 static int msgPartFromUrl(
const KURL &url);
279 void setUpdateAttachment(
bool update =
true ) { mAtmUpdate = update; }
288 void openAttachment(
int id,
const TQString & name );
289 void saveAttachment(
const KURL &tempFileName );
291 void emitUrlClicked(
const KURL & url,
int button ) {
292 emit urlClicked( url, button );
295 void emitPopupMenu(
const KURL & url,
const TQPoint & p ) {
297 emit popupMenu( *message(), url, p );
300 void showAttachmentPopup(
int id,
const TQString & name,
const TQPoint & p );
306 TQWidget* mainWindow() {
return mMainWindow; }
309 bool decryptMessage()
const;
321 bool showAttachmentQuicklist()
const {
return mShowAttachmentQuicklist; }
324 void setShowAttachmentQuicklist(
bool showAttachmentQuicklist =
true ) { mShowAttachmentQuicklist = showAttachmentQuicklist; }
328 bool showRawToltecMail()
const {
return mShowRawToltecMail; }
329 void setShowRawToltecMail(
bool showRawToltecMail ) { mShowRawToltecMail = showRawToltecMail; }
340 void scrollToAttachment(
const partNode *node );
345 void clearBodyPartMementos();
350 void replaceMsgByUnencryptedVersion();
353 void popupMenu(
KMMessage &msg,
const KURL &url,
const TQPoint& mousePos);
356 void urlClicked(
const KURL &url,
int button);
370 void updateReaderWin();
374 void slotScrollDown();
375 void slotScrollPrior();
376 void slotScrollNext();
378 void slotDocumentChanged();
379 void slotDocumentDone();
380 void slotTextSelected(
bool);
384 void slotUrlOpen(
const KURL &url,
const KParts::URLArgs &args);
387 void slotUrlOn(
const TQString &url);
390 void slotUrlPopup(
const TQString &,
const TQPoint& mousePos);
398 void slotToggleFixedFont();
401 void slotCopySelectedText();
403 void slotUrlClicked();
406 void slotMailtoReply();
407 void slotMailtoCompose();
408 void slotMailtoForward();
409 void slotMailtoAddAddrBook();
410 void slotMailtoOpenAddrBook();
414 void slotUrlOpen(
const KURL &url = KURL() );
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();
436 void fillCommandInfo( partNode *node,
KMMessage **msg,
int *nodeId );
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();
460 void slotAtmView(
int id,
const TQString& name );
461 void slotDelayedResize();
462 void slotHandleAttachment(
int );
467 void disconnectMsgAdded();
468 void msgAdded( TQListViewItem *item );
473 void styleChange( TQStyle& oldStyle );
477 void setStyleDependantFrameWidth();
480 virtual bool event(TQEvent *e);
483 int pointsToPixel(
int pointSize)
const;
487 void displayMessage();
494 TQString writeMsgHeader(
KMMessage* aMsg, partNode *vCardNode = 0,
bool topLevel=
false );
499 TQString writeMessagePartToTempFile( KMMessagePart* msgPart,
int partNumber );
506 TQString createTempDir(
const TQString ¶m = TQString() );
509 void showVCard(KMMessagePart *msgPart);
512 virtual void initHtmlWidget(
void);
515 virtual void closeEvent(TQCloseEvent *);
516 virtual void resizeEvent(TQResizeEvent *);
519 virtual void removeTempFiles();
522 bool eventFilter( TQObject *obj, TQEvent *ev );
525 void slotSetEncoding();
526 void injectAttachments();
530 void createWidgets();
531 void createActions( TDEActionCollection * ac );
532 void saveSplitterSizes( TDEConfigBase & c )
const;
535 const KMail::HeaderStrategy * );
536 TDERadioAction * 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;
557 TDEHTMLPart *mViewer;
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 TQTimer mHeaderRefreshTimer;
570 TQString mOverrideEncoding;
571 TQString mOldGlobalOverrideEncoding;
573 bool mNoMDNsWhenEncrypted;
574 unsigned long mLastSerNum;
576 KMail::CSSHelper * mCSSHelper;
581 TQStringList mTempFiles;
582 TQStringList mTempDirs;
584 bool mMimeTreeAtBottom;
585 TQValueList<int> mSplitterSizes;
587 TQString mIdOfLastViewedMessage;
588 TQWidget *mMainWindow;
589 TDEActionCollection *mActionCollection;
590 TDEAction *mMailToComposeAction, *mMailToReplyAction, *mMailToForwardAction,
591 *mAddAddrBookAction, *mOpenAddrBookAction, *mCopyAction, *mCopyURLAction,
592 *mUrlOpenAction, *mUrlSaveAsAction, *mAddBookmarksAction, *mStartIMChatAction, *mSelectAllAction;
593 TDEToggleAction *mHeaderOnlyAttachmentsAction;
594 TDESelectAction *mSelectEncodingAction;
595 TDEToggleAction *mToggleFixFontAction;
599 TQPoint mLastClickPosition;
600 TQString mLastClickImagePath;
604 std::map<TQCString,KMail::Interface::BodyPartMemento*> mBodyPartMementoMap;
608 unsigned long mWaitingForSerNum;
609 float mSavedRelativePosition;
611 bool mDecrytMessageOverwrite;
612 bool mShowSignatureDetails;
613 bool mShowAttachmentQuicklist;
614 bool mShowRawToltecMail;
615 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.