kmail
kmedit.h00001
00002
00003
00004
00005 #ifndef __KMAIL_KMEDIT_H__
00006 #define __KMAIL_KMEDIT_H__
00007
00008 #include <kdeversion.h>
00009 #include <keditcl.h>
00010 #include <qmap.h>
00011 #include <qstringlist.h>
00012
00013 class KMComposeWin;
00014 class KSpellConfig;
00015 class KSpell;
00016 class SpellingFilter;
00017 class KTempFile;
00018 class KDictSpellingHighlighter;
00019 class KDirWatch;
00020 class KProcess;
00021 class QPopupMenu;
00022
00023
00024 class KMEdit : public KEdit {
00025 Q_OBJECT
00026 public:
00027 KMEdit(QWidget *parent=0,KMComposeWin* composer=0,
00028 KSpellConfig* spellConfig = 0,
00029 const char *name=0);
00030 ~KMEdit();
00031
00035 void spellcheck();
00036
00040 QString brokenText();
00041
00045 int autoSpellChecking( bool );
00046
00050 void setUseExternalEditor( bool use ) { mUseExtEditor = use; }
00051 void setExternalEditorPath( const QString & path ) { mExtEditor = path; }
00052
00059 bool checkExternalEditorFinished();
00060
00061 QPopupMenu* createPopupMenu(const QPoint&);
00062 void setSpellCheckingActive(bool spellCheckingActive);
00063
00065 void contentsDragEnterEvent(QDragEnterEvent *e);
00066 void contentsDragMoveEvent(QDragMoveEvent *e);
00067 void contentsDropEvent(QDropEvent *e);
00068
00069 void deleteAutoSpellChecking();
00070
00071 unsigned int lineBreakColumn() const;
00072
00074 void setCursorPositionFromStart(unsigned int pos);
00075
00076 signals:
00077 void spellcheck_done(int result);
00078 void attachPNGImageData(const QByteArray &image);
00079 void pasteImage();
00080 void focusUp();
00081 void focusChanged( bool );
00082 public slots:
00083 void initializeAutoSpellChecking();
00084 void slotSpellcheck2(KSpell*);
00085 void slotSpellResult(const QString&);
00086 void slotSpellDone();
00087 void slotExternalEditorDone(KProcess*);
00088 void slotMisspelling(const QString &, const QStringList &, unsigned int);
00089 void slotCorrected (const QString &, const QString &, unsigned int);
00090 void addSuggestion(const QString& text, const QStringList& lst, unsigned int );
00091 void cut();
00092 void clear();
00093 void del();
00094 void paste();
00095 protected:
00099 bool eventFilter(QObject*, QEvent*);
00100 void keyPressEvent( QKeyEvent* );
00101
00102 private slots:
00103 void slotExternalEditorTempFileChanged( const QString & fileName );
00104
00105 private:
00106 void killExternalEditor();
00107
00108 private:
00109 KMComposeWin* mComposer;
00110
00111 KSpell *mKSpell;
00112 KSpellConfig *mSpellConfig;
00113 QMap<QString,QStringList> mReplacements;
00114 SpellingFilter* mSpellingFilter;
00115 KTempFile *mExtEditorTempFile;
00116 KDirWatch *mExtEditorTempFileWatcher;
00117 KProcess *mExtEditorProcess;
00118 bool mUseExtEditor;
00119 QString mExtEditor;
00120 bool mWasModifiedBeforeSpellCheck;
00121 KDictSpellingHighlighter *mSpellChecker;
00122 bool mSpellLineEdit;
00123 };
00124
00125 #endif // __KMAIL_KMEDIT_H__
00126
|