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   
00074   void setCursorPositionFromStart(unsigned int pos);
00075 
00076 signals:
00077   void spellcheck_done(int result);
00078   void pasteImage();
00079   void focusUp();
00080   void focusChanged( bool );
00081 public slots:
00082   void initializeAutoSpellChecking();
00083   void slotSpellcheck2(KSpell*);
00084   void slotSpellResult(const QString&);
00085   void slotSpellDone();
00086   void slotExternalEditorDone(KProcess*);
00087   void slotMisspelling(const QString &, const QStringList &, unsigned int);
00088   void slotCorrected (const QString &, const QString &, unsigned int);
00089   void addSuggestion(const QString& text, const QStringList& lst, unsigned int );
00090   void cut();
00091   void clear();
00092   void del();
00093   void paste();
00094 protected:
00098   bool eventFilter(QObject*, QEvent*);
00099   void keyPressEvent( QKeyEvent* );
00100 
00101 private slots:
00102   void slotExternalEditorTempFileChanged( const QString & fileName );
00103 
00104 private:
00105   void killExternalEditor();
00106 
00107 private:
00108   KMComposeWin* mComposer;
00109 
00110   KSpell *mKSpell;
00111   KSpellConfig *mSpellConfig;
00112   QMap<QString,QStringList> mReplacements;
00113   SpellingFilter* mSpellingFilter;
00114   KTempFile *mExtEditorTempFile;
00115   KDirWatch *mExtEditorTempFileWatcher;
00116   KProcess  *mExtEditorProcess;
00117   bool      mUseExtEditor;
00118   QString   mExtEditor;
00119   bool      mWasModifiedBeforeSpellCheck;
00120   KDictSpellingHighlighter *mSpellChecker;
00121   bool mSpellLineEdit;
00122 };
00123 
00124 #endif // __KMAIL_KMEDIT_H__
00125 
KDE Home | KDE Accessibility Home | Description of Access Keys