5#ifndef __KMAIL_KMEDIT_H__
6#define __KMAIL_KMEDIT_H__
10#include <ksyntaxhighlighter.h>
12#include <tqstringlist.h>
13#include <tqclipboard.h>
32 KMSpell( TQObject *receiver,
const char *slot, KSpellConfig *spellConfig );
33 using KSpell::writePersonalDictionary;
44 bool spellCheckingActive =
true,
45 bool autoEnable =
true,
46 const TQColor& spellColor = red,
47 bool colorQuoting =
false,
48 const TQColor& QuoteColor0 = black,
49 const TQColor& QuoteColor1 = TQColor( 0x00, 0x80, 0x00 ),
50 const TQColor& QuoteColor2 = TQColor( 0x00, 0x70, 0x00 ),
51 const TQColor& QuoteColor3 = TQColor( 0x00, 0x60, 0x00 ),
52 KSpellConfig *spellConfig = 0 );
57 void ignoreWord(
const TQString &word );
59 TQStringList ignoredWords()
const;
62 TQStringList mIgnoredWords;
65class KMEdit :
public KEdit {
69 KMEdit(TQWidget *parent=0,KMComposeWin* composer=0,
70 KSpellConfig* spellConfig = 0,
82 TQString brokenText();
87 int autoSpellChecking(
bool );
92 void setUseExternalEditor(
bool use ) { mUseExtEditor = use; }
93 void setExternalEditorPath(
const TQString & path ) { mExtEditor = path; }
101 bool checkExternalEditorFinished();
103 TQPopupMenu* createPopupMenu(
const TQPoint&);
104 void setSpellCheckingActive(
bool spellCheckingActive);
107 void contentsDragEnterEvent(TQDragEnterEvent *e);
108 void contentsDragMoveEvent(TQDragMoveEvent *e);
109 void contentsDropEvent(TQDropEvent *e);
111 void deleteAutoSpellChecking();
113 unsigned int lineBreakColumn()
const;
116 void setCursorPositionFromStart(
unsigned int pos);
118 int indexOfCurrentLineStart(
int paragraph,
int index );
121 void spellcheck_done(
int result);
122 void attachPNGImageData(
const TQByteArray &image);
125 void focusChanged(
bool );
126 void selectionAvailable(
bool );
127 void insertSnippet();
129 void initializeAutoSpellChecking();
130 void slotSpellcheck2(KSpell*);
131 void slotSpellResult(
const TQString&);
132 void slotSpellDone();
133 void slotExternalEditorDone(TDEProcess*);
134 void slotMisspelling(
const TQString &,
const TQStringList &,
unsigned int);
135 void slotCorrected (
const TQString &,
const TQString &,
unsigned int);
136 void addSuggestion(
const TQString& text,
const TQStringList& lst,
unsigned int );
145 bool eventFilter(TQObject*, TQEvent*);
146 void keyPressEvent( TQKeyEvent* );
148 void contentsMouseReleaseEvent( TQMouseEvent * e );
152 virtual void contentsMouseDoubleClickEvent( TQMouseEvent *e );
155 void slotExternalEditorTempFileChanged(
const TQString & fileName );
156 void slotSelectionChanged() {
158 emit selectionAvailable( !selectedText().isEmpty() );
163 void spellerReady( KSpell *speller );
169 void createSpellers();
172 void killExternalEditor();
175 KMComposeWin* mComposer;
179 KSpell *mKSpellForDialog;
185 KSpellConfig *mSpellConfig;
186 TQMap<TQString,TQStringList> mReplacements;
187 SpellingFilter* mSpellingFilter;
188 KTempFile *mExtEditorTempFile;
189 KDirWatch *mExtEditorTempFileWatcher;
190 TDEProcess *mExtEditorProcess;
193 bool mWasModifiedBeforeSpellCheck;
196 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.