00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#ifndef __KOISPELL_H__
00020
#define __KOISPELL_H__
00021
00022
#include "koSconfig.h"
00023
00024
#include <qobject.h>
00025
#include <qstringlist.h>
00026
#include <qstring.h>
00027
#include "koSpell.h"
00028
00029
class KProcIO;
00030
class KProcess;
00031
class KOSpellDlg;
00032
00033
class KOISpell :
public KOSpell
00034 {
00035 Q_OBJECT
00036
00037
public:
00038
00039 KOISpell(
QWidget *_parent,
const QString &_caption,
00040
QObject *obj,
const char *slot,
KOSpellConfig *_ksc = 0,
00041
bool _progressbar = TRUE,
bool _modal = FALSE, KOSpellerType type= Text );
00042
00043
virtual void cleanUp ();
00044
00045
00046
virtual bool check (
const QString &_buffer,
bool usedialog = TRUE);
00047
00048
virtual QStringList resultCheckWord(
const QString & );
00049
00050
00051
virtual bool checkList (
QStringList *_wordlist,
bool usedialog = TRUE);
00052
00053
00054
virtual bool checkWord (
const QString &_buffer,
bool usedialog = FALSE);
00055
bool checkWord(
const QString &_buffer,
bool usedialog,
bool synchronous );
00056
00057
00058
virtual bool ignore (
const QString & word);
00059
00060
virtual bool addPersonal (
const QString & word);
00061
00062
00063
void setProgressResolution (
unsigned res);
00064
00065
virtual ~KOISpell();
00066
00067
static int modalCheck(
QString& text,
KOSpellConfig * kcs );
00068
00069
protected slots:
00070
00071
void KSpell2 (KProcIO *);
00072
void checkWord2 (KProcIO *);
00073
void checkWord2Synchronous (KProcIO *);
00074
void checkWord3 ();
00075
void check2 (KProcIO *);
00076
void checkList2 ();
00077
void checkList3a (KProcIO *);
00078
void checkListReplaceCurrent ();
00079
void checkList4 ();
00080
void dialog2 (
int dlgresult);
00081
void check3 ();
00082
00083
void slotStopCancel (
int);
00084
void ispellExit (KProcess *);
00085
void emitDeath();
00086
void ispellErrors (KProcess *,
char *,
int);
00087
00088
private slots:
00092
void slotModalReady();
00093
00094
void slotModalDone(
const QString & );
00095
void slotSpellCheckerCorrected(
const QString & oldText,
const QString & newText,
unsigned int );
00096
void slotModalSpellCheckerFinished( );
00097
void slotSynchronousReady();
00098
00099 signals:
00100
void dialog3 ();
00105
void progress (
unsigned int i);
00106
00107
protected:
00108
00109 KProcIO *proc;
00110
00111
00112
bool texmode;
00113
bool dlgon;
00114
00115
bool progressbar;
00116
bool dialogsetup;
00117
00118
00119
QString dialog3slot;
00120
00121
int trystart;
00122
int maxtrystart;
00123
unsigned int progres;
00124
unsigned int curprog;
00125
00129
bool modaldlg;
00130
00131
00132
int parseOneResponse (
const QString &_buffer,
QString &word,
QStringList &sugg);
00133
QString funnyWord (
const QString & word);
00134
void dialog (
const QString & word,
QStringList & sugg,
const char* _slot);
00135
00136
void setUpDialog (
bool reallyusedialogbox = TRUE);
00137
00138
void emitProgress ();
00139
bool cleanFputs (
const QString & s,
bool appendCR=TRUE);
00140
bool cleanFputsWord (
const QString & s,
bool appendCR=TRUE);
00141
void startIspell();
00142
bool writePersonalDictionary ();
00143
void initialize(
QWidget *_parent,
const QString &_caption,
00144
QObject *obj,
const char *slot,
KOSpellConfig *_ksc,
00145
bool _progressbar,
bool _modal );
00146
void enter_loop();
00147
bool m_ready;
00148 };
00149
00150
00151
#endif