00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef __KOSCONFIG_H__
00019
#define __KOSCONFIG_H__
00020
00021
#include <qwidget.h>
00022
#include <qstring.h>
00023
#include <qstringlist.h>
00024
00025
class QCheckBox;
00026
class QComboBox;
00027
class QLabel;
00028
00029
class KConfig;
00030
class KOSpellConfigPrivate;
00031
00032
00033
00034
00035
enum OEncoding {
00036 KOS_E_ASCII=0,
00037 KOS_E_LATIN1=1,
00038 KOS_E_LATIN2=2,
00039 KOS_E_LATIN3=3,
00040 KOS_E_LATIN4=4,
00041 KOS_E_LATIN5=5,
00042 KOS_E_LATIN7=6,
00043 KOS_E_LATIN8=7,
00044 KOS_E_LATIN9=8,
00045 KOS_E_LATIN13=9,
00046 KOS_E_LATIN15=10,
00047 KOS_E_UTF8=11,
00048 KOS_E_KOI8R=12,
00049 KOS_E_KOI8U=13,
00050 KOS_E_CP1251=14
00051 };
00052
00053
enum KOSpellClients {
00054 KOS_CLIENT_ISPELL=0,
00055 KOS_CLIENT_ASPELL=1,
00056 KOS_CLIENT_HSPELL=2,
00057 KOS_CLIENT_MYSPELL=3
00058 };
00059
00080 class KOSpellConfig :
public QWidget
00081 {
00082 Q_OBJECT
00083
00084
public:
00096
KOSpellConfig(
QWidget *parent=0,
const char *name=0,
00097
KOSpellConfig *spellConfig=0,
bool addHelpButton =
true );
00098
00099
KOSpellConfig (
const KOSpellConfig &);
00100
00101
virtual ~
KOSpellConfig ();
00102
00103
void operator= (
const KOSpellConfig &ksc);
00104
00119
void setIgnoreList (
QStringList _ignorelist);
00120
00126
void setReplaceAllList (
QStringList _replaceAllList);
00127
00133
void setNoRootAffix (
bool);
00134
00140
void setRunTogether(
bool);
00141
00145
void setDictionary (
const QString &qs);
00146
void setDictFromList (
bool dfl);
00147
00148
00149
void setIgnoreCase (
bool b );
00150
void setIgnoreAccent (
bool b );
00151
void setSpellWordWithNumber (
bool b );
00152
00153
void setDontCheckTitleCase(
bool _b);
00154
void setDontCheckUpperWord(
bool _b);
00158
void setEncoding (
int enctype);
00159
void setClient (
int client);
00163
bool noRootAffix ()
const;
00164
bool runTogether()
const;
00165
const QString dictionary ()
const;
00166
bool dictFromList ()
const;
00167
00168
bool ignoreCase ()
const;
00169
bool ignoreAccent ()
const;
00170
int encoding ()
const;
00171
bool spellWordWithNumber()
const;
00172
QStringList ignoreList ()
const;
00173
QStringList replaceAllList ()
const;
00174
00175
bool dontCheckTitleCase()
const;
00176
bool dontCheckUpperWord()
const;
00177
00178
00179
int client ()
const;
00185
bool writeGlobalSettings ();
00186
00187
00188
static QStringList listOfAspellLanguages();
00189
static QStringList listOfLanguageFileName();
00190
static QString fileNameFromLanguage(
const QString & _lang);
00191
static QString languageFromFileName(
const QString &_lang );
00192
static int indexFromLanguageFileName(
const QString &name);
00193
00194
protected:
00195
void fillInDialog();
00196
bool readGlobalSettings();
00197
QString getLanguage(
int i );
00198
00208
static bool interpret(
QString &fname,
QString &lname,
QString &hname );
00209
00210
00211
public slots:
00220
void activateHelp(
void );
00221
00222
00223
protected slots:
00224
void sHelp();
00225
void sNoAff(
bool);
00226
void sRunTogether(
bool);
00227
void sDictionary(
bool);
00228
void sPathDictionary(
bool);
00229
void sSetDictionary (
int);
00230
void sChangeEncoding (
int);
00231
void sChangeClient (
int);
00232
00233
void slotIgnoreCase(
bool );
00234
void slotIgnoreAccent(
bool);
00235
void slotSpellWordWithNumber(
bool b);
00236
void slotDontSpellCheckUpperWord(
bool);
00237
void slotDontCheckTitleCase(
bool);
00238
00239
protected:
00240
00241
int enc;
00242
bool bnorootaffix;
00243
bool bruntogether;
00244
bool dictfromlist;
00245
bool nodialog;
00246
bool m_bIgnoreCase;
00247
bool m_bIgnoreAccent;
00248
bool m_bSpellWordWithNumber;
00249
bool m_bDontCheckUpperWord;
00250
bool m_bDontCheckTitleCase;
00251
QString qsdict;
00252
QString qspdict;
00253
QStringList ignorelist;
00254
enum {rdictlist=3, rencoding=4, rhelp=6};
00255 KConfig *kc;
00256
int iclient;
00257
QCheckBox *cb1, *cb2;
00258
QLabel *dictlist;
00259
QComboBox *dictcombo, *encodingcombo, *clientcombo;
00260
QCheckBox *cbIgnoreCase;
00261
QCheckBox *cbIgnoreAccent;
00262
QCheckBox *cbSpellWordWithNumber;
00263
QCheckBox *cbDontCheckUpperWord;
00264
QCheckBox *cbDontCheckTitleCase;
00265
00266
00267
QStringList langfnames;
00268
00269
virtual void showEvent(
QShowEvent* );
00270
00271 signals:
00272
void configChanged();
00273
00274
private:
00275 KOSpellConfigPrivate *d;
00276
void getAvailDictsIspell();
00277
void getAvailDictsAspell();
00278
00279
static void createListOfLanguages();
00280
static QStringList s_aspellLanguageList;
00281
static QStringList s_aspellLanguageFileName;
00282 };
00283
00284
#endif
00285
00286
00287
00288
00289