19 #ifndef __TDESPELL_H__
20 #define __TDESPELL_H__
25 #include <tqstringlist.h>
27 #include <tdelibs_export.h>
46 class TDEUI_EXPORT
KSpell :
public TQObject
65 enum spellStatus { Starting = 0, Running, Cleaning, Finished, Error, Crashed, FinishedNoMisspellingsEncountered };
99 KSpell(TQWidget *parent,
const TQString &caption,
100 TQObject *receiver,
const char *slot,
KSpellConfig *kcs=0,
101 bool progressbar =
true,
bool modal =
false);
121 KSpell(TQWidget *parent,
const TQString &caption,
122 TQObject *receiver,
const char *slot,
KSpellConfig *kcs,
123 bool progressbar,
bool modal, SpellerType type);
139 virtual void cleanUp ();
160 virtual bool check (
const TQString &_buffer,
bool usedialog =
true);
180 virtual bool checkList (TQStringList *_wordlist,
bool usedialog =
true);
204 virtual bool checkWord (
const TQString &_buffer,
bool usedialog =
false);
205 bool checkWord(
const TQString & buffer,
bool _usedialog,
bool suggest );
241 {
return dlgresult; }
251 void moveDlg (
int x,
int y);
256 int heightDlg ()
const;
260 int widthDlg ()
const;
275 virtual bool ignore (
const TQString & word);
283 virtual bool addPersonal (
const TQString & word);
297 void setProgressResolution (
unsigned int res);
313 static int modalCheck( TQString& text ) TDE_DEPRECATED;
323 static int modalCheck( TQString& text,
KSpellConfig * kcs );
329 void setIgnoreUpperWords(
bool b);
336 void setIgnoreTitleCase(
bool b);
357 void misspelling (
const TQString & originalword,
const TQStringList & suggestions,
375 void corrected (
const TQString & originalword,
const TQString & newword,
unsigned int pos);
403 void replaceall(
const TQString & origword ,
const TQString &replacement );
425 void done (
const TQString &buffer);
457 void checkListReplaceCurrent ();
459 void dialog2 (
int dlgresult);
463 void slotStopCancel (
int);
466 void ispellErrors (
TDEProcess *,
char *,
int);
473 void slotModalReady();
478 void slotModalDone(
const TQString & );
483 void slotSpellCheckerCorrected(
const TQString & oldText,
const TQString & newText,
unsigned int );
488 void slotModalSpellCheckerFinished( );
499 TQStringList *wordlist;
500 TQStringList::Iterator wlIt;
501 TQStringList ignorelist;
502 TQStringList replacelist;
512 bool dialogwillprocess;
522 TQString dlgorigword;
523 TQString dlgreplacement;
524 TQString dialog3slot;
530 unsigned int totalpos;
531 unsigned int lastline;
532 unsigned int posinline;
533 unsigned int lastlastline;
535 unsigned int progres;
536 unsigned int curprog;
542 static TQString modaltext;
543 static int modalreturn;
544 static TQWidget* modalWidgetHack;
546 int parseOneResponse (
const TQString &_buffer, TQString &word, TQStringList &sugg);
547 TQString funnyWord (
const TQString & word);
548 void dialog (
const TQString & word, TQStringList & sugg,
const char* _slot);
549 TQString replacement ()
const
550 {
return dlgreplacement; }
552 void setUpDialog (
bool reallyusedialogbox =
true);
554 void emitProgress ();
555 bool cleanFputs (
const TQString & s,
bool appendCR=
true);
556 bool cleanFputsWord (
const TQString & s,
bool appendCR=
true);
558 bool writePersonalDictionary();
559 void initialize( TQWidget *_parent,
const TQString &_caption,
561 bool _progressbar,
bool _modal, SpellerType type );
A configuration class/dialog for KSpell.
void corrected(const TQString &originalword, const TQString &newword, unsigned int pos)
Emitted after the "Replace" or "Replace All" buttons of the dialog was pressed, or if the word was co...
spellStatus status() const
Returns the status of KSpell.
int lastPosition() const
Returns the position (when using check()) or word number (when using checkList()) of the last word ch...
void ready(KSpell *)
Emitted after KSpell has verified that ISpell/ASpell is running and working properly.
void ignoreword(const TQString &originalword)
Emitted when the user pressed "Ignore" in the dialog.
TQString intermediateBuffer() const
Returns the partially spellchecked buffer.
void ignoreall(const TQString &originalword)
Emitted when the user pressed "Ignore All" in the dialog.
int dlgResult() const
Gets the result code of the dialog box.
void misspelling(const TQString &originalword, const TQStringList &suggestions, unsigned int pos)
Emitted whenever a misspelled word is found by check() or by checkWord().
void setAutoDelete(bool _autoDelete)
Sets the auto-delete flag.
void done(bool)
Emitted when checkList() is done.
TQStringList suggestions() const
Returns list of suggested word replacements.
SpellerType
These are possible types of documents which the spell checker can check.
spellStatus
Possible states of the spell checker.
void replaceall(const TQString &origword, const TQString &replacement)
Emitted when the user pressed "ReplaceAll" in the dialog.
void progress(unsigned int i)
Emitted during a check().
bool modaldlg
Used for modalCheck.
void addword(const TQString &originalword)
Emitted when the user pressed "Add" in the dialog.
void done(const TQString &buffer)
Emitted when check() is done.
void death()
Emitted on terminal errors and after clean up.