ksconfig.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef KDELIBS_KSCONFIG_H
00020 #define KDELIBS_KSCONFIG_H
00021
00022 #include <qwidget.h>
00023 #include <qstring.h>
00024 #include <qstringlist.h>
00025
00026 #include <kdelibs_export.h>
00027
00028 class QCheckBox;
00029 class QComboBox;
00030 class QLabel;
00031
00032 class KConfig;
00033 class KSpellConfigPrivate;
00034
00042 enum Encoding {
00043 KS_E_ASCII=0,
00044 KS_E_LATIN1=1,
00045 KS_E_LATIN2=2,
00046 KS_E_LATIN3=3,
00047 KS_E_LATIN4=4,
00048 KS_E_LATIN5=5,
00049 KS_E_LATIN7=6,
00050 KS_E_LATIN8=7,
00051 KS_E_LATIN9=8,
00052 KS_E_LATIN13=9,
00053 KS_E_LATIN15=10,
00054 KS_E_UTF8=11,
00055 KS_E_KOI8R=12,
00056 KS_E_KOI8U=13,
00057 KS_E_CP1251=14,
00058 KS_E_CP1255=15
00059 };
00060
00061 enum KSpellClients {
00062 KS_CLIENT_ISPELL=0,
00063 KS_CLIENT_ASPELL=1,
00064 KS_CLIENT_HSPELL=2,
00065 KS_CLIENT_ZEMBEREK=3,
00066 KS_CLIENT_HUNSPELL=4
00067 };
00068
00089 class KDEUI_EXPORT KSpellConfig : public QWidget
00090 {
00091 Q_OBJECT
00092
00093 public:
00105 KSpellConfig( QWidget *parent=0, const char *name=0,
00106 KSpellConfig *spellConfig=0, bool addHelpButton = true );
00107
00108 KSpellConfig( const KSpellConfig & );
00109
00114 virtual ~KSpellConfig();
00115
00116 void operator=( const KSpellConfig &ksc );
00117
00136 void fillDicts( QComboBox* box, QStringList* dictionaries = 0 );
00137
00152 void setIgnoreList( QStringList _ignorelist );
00153
00159 void setReplaceAllList( QStringList _replaceAllList );
00160
00166 void setNoRootAffix( bool );
00167
00173 void setRunTogether( bool );
00174
00178 void setDictionary( const QString qs );
00179 void setDictFromList( bool dfl );
00180
00181
00185 void setEncoding( int enctype );
00186 void setClient( int client );
00187
00191 bool noRootAffix() const;
00192 bool runTogether() const;
00193 const QString dictionary() const;
00194 bool dictFromList() const;
00195
00196 int encoding() const;
00197 QStringList ignoreList() const;
00198 QStringList replaceAllList() const;
00199
00200 int client() const;
00201
00207 bool writeGlobalSettings();
00208
00209 bool readGlobalSettings();
00210 protected:
00211 void fillInDialog();
00212
00226 bool interpret( QString &fname, QString &lname, QString &hname );
00227
00228
00229 public slots:
00238 void activateHelp( void );
00239
00240
00241 protected slots:
00245 void sHelp();
00246
00247
00248 void sNoAff( bool );
00249 void sRunTogether( bool );
00250 void sDictionary( bool );
00251 void sPathDictionary( bool );
00252 void sSetDictionary( int );
00253 void sChangeEncoding( int );
00254 void sChangeClient( int );
00255
00256
00257
00258 protected:
00259
00260 int enc;
00261 bool bnorootaffix;
00262 bool bruntogether;
00263 bool dictfromlist;
00264 bool nodialog;
00265 QString qsdict;
00266 QString qspdict;
00267 QStringList ignorelist;
00268 enum {rdictlist=3, rencoding=4, rhelp=6};
00269 KConfig *kc;
00270 int iclient;
00271
00272 QCheckBox *cb1, *cb2;
00273
00274
00275
00276 QLabel *dictlist;
00277 QComboBox *dictcombo, *encodingcombo, *clientcombo;
00278
00279 QStringList langfnames;
00280
00281 signals:
00282 void configChanged();
00283
00284 private:
00285 KSpellConfigPrivate *d;
00286 void getAvailDictsIspell();
00287 void getAvailDictsAspell();
00288 void getAvailDictsHunspell();
00289 };
00290
00291 #endif // KDELIBS_KSCONFIG_H
00292
00293
00294
00295
00296
|