5 #ifndef __KMAIL_KMEDIT_H__
6 #define __KMAIL_KMEDIT_H__
8 #include <tdeversion.h>
11 #include <ksyntaxhighlighter.h>
13 #include <tqstringlist.h>
14 #include <tqclipboard.h>
33 KMSpell( TQObject *receiver,
const char *slot, KSpellConfig *spellConfig );
34 using KSpell::writePersonalDictionary;
45 bool spellCheckingActive =
true,
46 bool autoEnable =
true,
47 const TQColor& spellColor = red,
48 bool colorQuoting =
false,
49 const TQColor& QuoteColor0 = black,
50 const TQColor& QuoteColor1 = TQColor( 0x00, 0x80, 0x00 ),
51 const TQColor& QuoteColor2 = TQColor( 0x00, 0x70, 0x00 ),
52 const TQColor& QuoteColor3 = TQColor( 0x00, 0x60, 0x00 ),
53 KSpellConfig *spellConfig = 0 );
58 void ignoreWord(
const TQString &word );
60 TQStringList ignoredWords()
const;
63 TQStringList mIgnoredWords;
66 class KMEdit :
public KEdit {
70 KMEdit(TQWidget *parent=0,KMComposeWin* composer=0,
71 KSpellConfig* spellConfig = 0,
83 TQString brokenText();
88 int autoSpellChecking(
bool );
93 void setUseExternalEditor(
bool use ) { mUseExtEditor = use; }
94 void setExternalEditorPath(
const TQString & path ) { mExtEditor = path; }
102 bool checkExternalEditorFinished();
104 TQPopupMenu* createPopupMenu(
const TQPoint&);
105 void setSpellCheckingActive(
bool spellCheckingActive);
108 void contentsDragEnterEvent(TQDragEnterEvent *e);
109 void contentsDragMoveEvent(TQDragMoveEvent *e);
110 void contentsDropEvent(TQDropEvent *e);
112 void deleteAutoSpellChecking();
114 unsigned int lineBreakColumn()
const;
117 void setCursorPositionFromStart(
unsigned int pos);
119 int indexOfCurrentLineStart(
int paragraph,
int index );
122 void spellcheck_done(
int result);
123 void attachPNGImageData(
const TQByteArray &image);
126 void focusChanged(
bool );
127 void selectionAvailable(
bool );
128 void insertSnippet();
130 void initializeAutoSpellChecking();
131 void slotSpellcheck2(KSpell*);
132 void slotSpellResult(
const TQString&);
133 void slotSpellDone();
134 void slotExternalEditorDone(TDEProcess*);
135 void slotMisspelling(
const TQString &,
const TQStringList &,
unsigned int);
136 void slotCorrected (
const TQString &,
const TQString &,
unsigned int);
137 void addSuggestion(
const TQString& text,
const TQStringList& lst,
unsigned int );
146 bool eventFilter(TQObject*, TQEvent*);
147 void keyPressEvent( TQKeyEvent* );
149 void contentsMouseReleaseEvent( TQMouseEvent * e );
153 virtual void contentsMouseDoubleClickEvent( TQMouseEvent *e );
156 void slotExternalEditorTempFileChanged(
const TQString & fileName );
157 void slotSelectionChanged() {
159 emit selectionAvailable( !selectedText().isEmpty() );
164 void spellerReady( KSpell *speller );
170 void createSpellers();
173 void killExternalEditor();
176 KMComposeWin* mComposer;
180 KSpell *mKSpellForDialog;
186 KSpellConfig *mSpellConfig;
187 TQMap<TQString,TQStringList> mReplacements;
188 SpellingFilter* mSpellingFilter;
189 KTempFile *mExtEditorTempFile;
190 KDirWatch *mExtEditorTempFileWatcher;
191 TDEProcess *mExtEditorProcess;
194 bool mWasModifiedBeforeSpellCheck;
197 TQClipboard::Mode mPasteMode;
Reimplemented to make writePersonalDictionary() public, which we call everytime after adding a word t...
Reimplemented to add support for ignored words.
virtual bool isMisspelled(const TQString &word)
Reimplemented.