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);
167 int lastPosition()
const
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 );
240 int dlgResult ()
const
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 ) KDE_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);
383 void ignoreall (
const TQString & originalword);
390 void ignoreword (
const TQString & originalword);
398 void addword (
const TQString & originalword);
403 void replaceall(
const TQString & origword ,
const TQString &replacement );
415 void progress (
unsigned int i);
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;
506 spellStatus m_status;
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 );