kmail

kmedit.h

00001 /* -*- mode: C++; c-file-style: "gnu" -*-
00002  * KMComposeWin Header File
00003  * Author: Markus Wuebben <markus.wuebben@kde.org>
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 
00073 signals:
00074   void spellcheck_done(int result);
00075   void pasteImage();
00076   void focusUp();
00077   void focusChanged( bool );
00078 public slots:
00079   void initializeAutoSpellChecking();
00080   void slotSpellcheck2(KSpell*);
00081   void slotSpellResult(const QString&);
00082   void slotSpellDone();
00083   void slotExternalEditorDone(KProcess*);
00084   void slotMisspelling(const QString &, const QStringList &, unsigned int);
00085   void slotCorrected (const QString &, const QString &, unsigned int);
00086   void addSuggestion(const QString& text, const QStringList& lst, unsigned int );
00087   void cut();
00088   void clear();
00089   void del();
00090   void paste();
00091 protected:
00095   bool eventFilter(QObject*, QEvent*);
00096   void keyPressEvent( QKeyEvent* );
00097 
00098 private slots:
00099   void slotExternalEditorTempFileChanged( const QString & fileName );
00100 
00101 private:
00102   void killExternalEditor();
00103 
00104 private:
00105   KMComposeWin* mComposer;
00106 
00107   KSpell *mKSpell;
00108   KSpellConfig *mSpellConfig;
00109   QMap<QString,QStringList> mReplacements;
00110   SpellingFilter* mSpellingFilter;
00111   KTempFile *mExtEditorTempFile;
00112   KDirWatch *mExtEditorTempFileWatcher;
00113   KProcess  *mExtEditorProcess;
00114   bool      mUseExtEditor;
00115   QString   mExtEditor;
00116   bool      mWasModifiedBeforeSpellCheck;
00117   KDictSpellingHighlighter *mSpellChecker;
00118   bool mSpellLineEdit;
00119 };
00120 
00121 #endif // __KMAIL_KMEDIT_H__
00122 
KDE Home | KDE Accessibility Home | Description of Access Keys