9 # ifndef REALLY_WANT_KMCOMPOSEWIN_H
10 # error Do not include kmcomposewin.h anymore. Include composer.h instead.
15 #include "messagesender.h"
20 #include <tqlistview.h>
22 #include <tqcheckbox.h>
23 #include <tqpushbutton.h>
24 #include <tqclipboard.h>
25 #include <tqpalette.h>
27 #include <tqptrlist.h>
28 #include <tqvaluevector.h>
29 #include <tqsplitter.h>
31 #include <tdeio/job.h>
32 #include <tdeglobalsettings.h>
33 #include <tdeversion.h>
37 #include "mailcomposerIface.h"
38 #include "accountmanager.h"
40 #include <libtdepim/addresseelineedit.h>
41 #include <mimelib/mediatyp.h>
43 #include <kleo/enum.h>
56 class KMFolderComboBox;
62 class TDESelectAction;
64 class TDEFontSizeAction;
65 class TDESelectAction;
68 class TDEToggleAction;
71 class TDEToggleAction;
72 class TDESelectColorAction;
74 class TDERecentFilesAction;
76 class MessageComposer;
77 class RecipientsEditor;
79 class KMLineEditSpell;
80 class KMAtmListViewItem;
89 class AttachmentListView;
90 class DictionaryComboBox;
103 friend class ::KMEdit;
104 friend class ::MessageComposer;
107 KMComposeWin(
KMMessage* msg=0, uint identity=0 );
110 static Composer * create(
KMMessage * msg = 0, uint identity = 0 );
120 void addAttachmentsAndSend(
const KURL::List &urls,
const TQString &comment,
int how);
123 const TQCString &cte,
124 const TQByteArray &data,
125 const TQCString &type,
126 const TQCString &subType,
127 const TQCString ¶mAttr,
128 const TQString ¶mValue,
129 const TQCString &contDisp);
137 virtual bool event(TQEvent *e);
142 void readColorConfig();
147 void writeConfig(
void);
153 void verifyWordWrapLengthIsAdequate(
const TQString&);
160 void setMsg(
KMMessage* newMsg,
bool mayAutoSign=TRUE,
161 bool allowDecryption=FALSE,
bool isModified=FALSE);
163 void disableWordWrap();
168 void disableRecipientNumberCheck();
173 void disableForgottenAttachmentsCheck();
184 void ignoreStickyFields();
189 bool isComposing()
const {
return mComposer != 0; }
202 void setAutoSaveFilename(
const TQString & filename );
208 bool isModified()
const;
213 void setModified(
bool modified );
220 inline void setAutoDelete(
bool f) { mAutoDeleteMsg = f; }
226 void setAutoDeleteWindow(
bool f );
233 void setFolder(
KMFolder* aFolder) { mFolder = aFolder; }
238 void setCharset(
const TQCString& aCharset,
bool forceDefault = FALSE);
246 void setReplyFocus(
bool hasMessage =
true );
252 void setFocusToSubject();
258 bool inlineSigningEncryptionSelected();
265 static TQString prettyMimeType(
const TQString& type );
266 TQString quotePrefixName()
const;
269 KMLineEditSpell *sujectLineWidget()
const {
return mEdtSubject;}
270 void setSubjectTextWasSpellChecked(
bool _spell ) {
271 mSubjectTextWasSpellChecked = _spell;
273 bool subjectTextWasSpellChecked()
const {
return mSubjectTextWasSpellChecked; }
275 void paste( TQClipboard::Mode mode );
279 void setSigningAndEncryptionDisabled(
bool v )
281 mSigningAndEncryptionExplicitlyDisabled = v;
290 void slotAttachFile();
291 void slotInsertRecentFile(
const KURL&);
292 void slotAttachedFile(
const KURL&);
296 void slotSendNowVia(
int item );
297 void slotSendLater();
298 void slotSendLaterVia(
int item );
300 void getTransportMenu();
305 void slotSaveDraft();
306 void slotSaveTemplate();
307 void slotNewComposer();
308 void slotNewMailReader();
313 void slotSearchAgain();
319 void slotPasteClipboard();
320 void slotPasteClipboardAsQuotation();
321 void slotPasteClipboardAsAttachment();
322 void slotAddQuotes();
323 void slotRemoveQuotes();
324 void slotAttachPNGImageData(
const TQByteArray &image);
339 void slotSetAlwaysSend(
bool bAlwaysSend );
344 void slotUpdateFont();
353 void slotInsertFile();
355 void slotSetCharset();
359 void slotSpellcheck();
360 void slotSpellcheckConfig();
361 void slotSubjectTextSpellChecked();
367 void slotSelectCryptoModule(
bool init =
false );
372 void slotStatusMessage(
const TQString &message);
373 void slotEditToolbars();
374 void slotUpdateToolbars();
379 void readConfig(
bool reload =
false );
383 void slotUpdWinTitle(
const TQString& );
389 void slotEncryptToggled(
bool);
394 void slotSignToggled(
bool);
400 void slotWordWrapToggled(
bool);
406 void slotAppendSignature();
411 void slotPrependSignature();
416 void slotInsertSignatureAtCursor();
421 void slotInsertMyPublicKey();
426 void slotInsertPublicKey();
431 void slotUpdateAttachActions();
436 void slotAttachPopupMenu(TQListViewItem *,
const TQPoint &,
int);
442 int currentAttachmentNum();
447 void slotAttachOpen();
448 void slotAttachView();
449 void slotAttachRemove();
450 void slotAttachSave();
451 void slotAttachProperties();
452 void slotAttachOpenWith();
453 void slotAttachEdit();
454 void slotAttachEditWith();
455 void slotAttachmentDragStarted();
461 void slotAddrBookTo();
462 void slotAddrBookFrom();
463 void slotAddrBookReplyTo();
465 void slotCleanSpace();
467 void slotToggleMarkup();
468 void toggleMarkup(
bool markup);
469 void htmlToolBarVisibilityChanged(
bool visible );
472 void slotSpellcheckDone(
int result);
473 void slotSpellcheckDoneClearStatus();
476 void autoSaveMessage();
479 void updateCursorPosition();
486 void slotIdentityChanged(uint);
491 void slotAttachFileData(TDEIO::Job *,
const TQByteArray &);
492 void slotAttachFileResult(TDEIO::Job *);
494 void slotListAction(
const TQString &);
495 void slotFontAction(
const TQString &);
496 void slotSizeAction(
int);
497 void slotAlignLeft();
498 void slotAlignCenter();
499 void slotAlignRight();
501 void slotTextItalic();
502 void slotTextUnder();
503 void slotFormatReset();
504 void slotTextColor();
505 void fontChanged(
const TQFont & );
506 void alignmentChanged(
int );
509 bool addAttach(
const KURL url);
515 void addAttach(
const KMMessagePart* msgPart);
518 const KPIM::Identity & identity()
const;
519 uint identityUid()
const;
520 Kleo::CryptoMessageFormat cryptoMessageFormat()
const;
521 bool encryptToSelf()
const;
524 void applyChangesDone(
bool );
525 void attachmentAdded(
const KURL&,
bool success );
535 void applyChanges(
bool dontSignNorEncrypt,
bool dontDisable=
false );
542 void rethinkFields(
bool fromslot=
false);
547 TQWidget *connectFocusMoving( TQWidget *prev, TQWidget *next );
553 void rethinkHeaderLine(
int aValue,
int aMask,
int& aRow,
555 TQLineEdit* aEdt, TQPushButton* aBtn = 0,
556 const TQString &toolTip = TQString(),
557 const TQString &whatsThis = TQString() );
559 void rethinkHeaderLine(
int value,
int mask,
int& row,
560 TQLabel* lbl, TQComboBox* cbx, TQCheckBox *chk );
566 bool checkRecipientNumber()
const;
569 bool checkTransport()
const;
575 void setupStatusBar();
582 TQString subject()
const;
585 TQString bcc()
const;
586 TQString from()
const;
587 TQString replyTo()
const;
594 void setFcc(
const TQString &idString );
599 virtual bool queryClose ();
603 virtual bool queryExit ();
608 void openAttach(
int index,
bool with );
613 void viewAttach(
int index );
618 void editAttach(
int index,
bool openWith );
623 void removeAttach(
const TQString &url);
624 void removeAttach(
int idx);
629 void msgPartToItem(
const KMMessagePart* msgPart, KMAtmListViewItem *lvi,
630 bool loadDefaults =
true );
636 void addrBookSelInto();
638 void addrBookSelIntoOld();
639 void addrBookSelIntoNew();
646 void setEncryption(
bool encrypt,
bool setByUser =
false );
652 void setSigning(
bool sign,
bool setByUser =
false );
657 bool userForgotAttachment();
663 bool encryptFlagOfAttachment(
int idx);
669 bool signFlagOfAttachment(
int idx);
679 static void decryptOrStripOffCleartextSignature( TQCString& );
684 bool saveDraftOrTemplate(
const TQString &folderName,
KMMessage *msg );
689 enum SaveIn { None, Drafts, Templates };
690 void doSend( KMail::MessageSender::SendMethod method=KMail::MessageSender::SendDefault,
691 KMComposeWin::SaveIn saveIn = KMComposeWin::None );
696 int autoSaveInterval()
const;
707 void updateAutoSave();
712 void cleanupAutoSave();
719 static bool validateAddresses( TQWidget * parent,
const TQString & addresses );
727 void setTransport(
const TQString & transport );
729 enum SignaturePlacement { Append, Prepend, AtCursor };
735 void insertSignature( SignaturePlacement placement = Append );
740 void compressAttach(
int idx);
741 void uncompressAttach(
int idx);
742 void editorFocusChanged(
bool gained);
743 void recipientEditorSizeHintChanged();
744 void setMaximumHeaderSize();
747 TQWidget *mMainWidget;
748 TQComboBox *mTransport;
750 KPIM::IdentityCombo *mIdentity;
751 KMFolderComboBox *mFcc;
752 KMLineEdit *mEdtFrom, *mEdtReplyTo, *mEdtTo, *mEdtCc, *mEdtBcc;
753 KMLineEditSpell *mEdtSubject;
754 TQLabel *mLblIdentity, *mLblTransport, *mLblFcc;
755 TQLabel *mLblFrom, *mLblReplyTo, *mLblTo, *mLblCc, *mLblBcc, *mLblSubject;
756 TQLabel *mDictionaryLabel;
757 TQCheckBox *mBtnIdentity, *mBtnDictionary, *mBtnTransport, *mBtnFcc;
758 TQPushButton *mBtnTo, *mBtnCc, *mBtnBcc, *mBtnReplyTo;
759 bool mSpellCheckInProgress;
762 TQListViewItem *mAtmSelectNew;
767 TQValueVector<KMMessage*> mComposedMessages;
768 KMail::AttachmentListView* mAtmListView;
772 int mAtmEncryptColWidth;
773 int mAtmSignColWidth;
774 int mAtmCompressColWidth;
775 TQPtrList<TQListViewItem> mAtmItemList;
776 TQPtrList<KMMessagePart> mAtmList;
777 TQPopupMenu *mAttachMenu;
778 int mOpenId, mOpenWithId, mViewId, mRemoveId, mSaveAsId, mPropertiesId, mEditId, mEditWithId;
780 bool mSigningAndEncryptionExplicitlyDisabled;
781 bool mLastSignActionState, mLastEncryptActionState;
782 bool mLastIdentityHasSigningKey, mLastIdentityHasEncryptionKey;
786 bool mDisableBreaking;
790 TQFont mBodyFont, mFixedFont;
791 TQPtrList<KTempFile> mAtmTempList;
794 TQString mOldSigText;
796 TDEAction *mAttachPK, *mAttachMPK,
797 *mAttachRemoveAction, *mAttachSaveAction, *mAttachPropertiesAction,
798 *mPasteQuotation, *mAddQuoteChars, *mRemQuoteChars;
799 TDERecentFilesAction *mRecentAction;
801 TDEAction *mAppendSignatureAction, *mPrependSignatureAction, *mInsertSignatureAction;
803 TDEToggleAction *mSignAction, *mEncryptAction, *mRequestMDNAction;
804 TDEToggleAction *mUrgentAction, *mAllFieldsAction, *mFromAction;
805 TDEToggleAction *mReplyToAction, *mToAction, *mCcAction, *mBccAction;
806 TDEToggleAction *mSubjectAction;
807 TDEToggleAction *mIdentityAction, *mTransportAction, *mFccAction;
808 TDEToggleAction *mWordWrapAction, *mFixedFontAction, *mAutoSpellCheckingAction;
809 TDEToggleAction *mDictionaryAction, *mSnippetAction;
811 TDESelectAction *listAction;
812 TDEFontAction *fontAction;
813 TDEFontSizeAction *fontSizeAction;
814 TDEToggleAction *alignLeftAction, *alignCenterAction, *alignRightAction;
815 TDEToggleAction *textBoldAction, *textItalicAction, *textUnderAction;
816 TDEToggleAction *plainTextAction, *markupAction;
817 TDEAction *actionFormatColor, *actionFormatReset;
818 TDEAction *mHtmlToolbar;
820 TDESelectAction *mEncodingAction;
821 TDESelectAction *mCryptoModuleAction;
824 TQCString mDefCharset;
825 TQStringList mCharsets;
830 TQStringList mFolderNames;
831 TQValueList<TQGuardedPtr<KMFolder> > mFolderList;
832 TQMap<TDEIO::Job*, KURL> mAttachJobs;
833 KURL::List mAttachFilesPending;
834 int mAttachFilesSend;
838 void startPublicKeyExport();
839 bool canSignEncryptAttachments()
const {
840 return cryptoMessageFormat() != Kleo::InlineOpenPGPFormat;
843 bool mSubjectTextWasSpellChecked;
845 TQString addQuotesToText(
const TQString &inputText );
846 TQString removeQuotesFromText(
const TQString &inputText );
848 int calcColumnWidth(
int which,
long allShowing,
int width);
851 void slotCompletionModeChanged( TDEGlobalSettings::Completion );
852 void slotConfigChanged();
854 void slotComposerDone(
bool );
856 void slotContinueDoSend(
bool );
857 void slotContinuePrint(
bool );
858 void slotContinueAutoSave();
860 void slotEncryptChiasmusToggled(
bool );
866 void slotPublicKeyExportResult(
const GpgME::Error & err,
const TQByteArray & keydata );
871 void slotAutoSpellCheckingToggled(
bool);
876 void slotUpdateSignatureActions();
881 void slotUpdateSignatureAndEncrypionStateIndicators();
883 TQColor mForeColor,mBackColor;
885 TQSplitter *mHeadersToEditorSplitter;
886 TQWidget* mHeadersArea;
887 TQSplitter *mSplitter;
888 TQSplitter *mSnippetSplitter;
896 TQMap<TDEIO::Job *, atmLoadData> mMapAtmLoadData;
899 KMail::MessageSender::SendMethod mSendMethod;
900 KMComposeWin::SaveIn mSaveIn;
902 TDEToggleAction *mEncryptChiasmusAction;
903 bool mEncryptWithChiasmus;
907 MessageComposer* mComposer;
910 bool mMessageWasModified;
913 TQString mFingerprint;
918 bool mClassicalRecipients;
920 RecipientsEditor *mRecipientsEditor;
923 TQTimer *mAutoSaveTimer;
924 TQString mAutoSaveFilename;
925 int mLastAutoSaveErrno;
927 TQPopupMenu *mActNowMenu;
928 TQPopupMenu *mActLaterMenu;
930 TQMap<KMail::EditorWatcher*, KMMessagePart*> mEditorMap;
931 TQMap<KMail::EditorWatcher*, KTempFile*> mEditorTempFiles;
933 TQLabel *mSignatureStateIndicator;
934 TQLabel *mEncryptionStateIndicator;
937 std::set<KTempDir*> mTempDirs;
946 bool mPreserveUserCursorPosition;
948 bool mPreventFccOverwrite;
949 bool mCheckForRecipients;
950 bool mCheckForForgottenAttachments;
951 bool mIgnoreStickyFields;
A combo box for selecting the dictionary used for spell checking.
Starts an editor for the given URL and emits an signal when editing has been finished.
DCOP interface for mail composer window.
virtual void setBody(TQString body)=0
Set message body.
virtual void addAttachment(KURL url, TQString comment)=0
Add url as attachment with a user-defined comment.
virtual void send(int how)=0
Send message.