kdeui
ksconfig.h
Go to the documentation of this file. 00001 /* This file is part of the KDE libraries
00002 Copyright (C) 1997 David Sweet <dsweet@kde.org>
00003
00004 This library is free software; you can redistribute it and/or
00005 modify it under the terms of the GNU Library General Public
00006 License version 2 as published by the Free Software Foundation.
00007
00008 This library is distributed in the hope that it will be useful,
00009 but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011 Library General Public License for more details.
00012
00013 You should have received a copy of the GNU Library General Public License
00014 along with this library; see the file COPYING.LIB. If not, write to
00015 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00016 Boston, MA 02110-1301, USA.
00017 */
00018 #ifndef KDELIBS_KSCONFIG_H
00019 #define KDELIBS_KSCONFIG_H
00020
00021 #include <qwidget.h>
00022 #include <qstring.h>
00023 #include <qstringlist.h>
00024
00025 #include <kdelibs_export.h>
00026
00027 class QCheckBox;
00028 class QComboBox;
00029 class QLabel;
00030
00031 class KConfig;
00032 class KSpellConfigPrivate;
00033
00041 enum Encoding {
00042 KS_E_ASCII=0,
00043 KS_E_LATIN1=1,
00044 KS_E_LATIN2=2,
00045 KS_E_LATIN3=3,
00046 KS_E_LATIN4=4,
00047 KS_E_LATIN5=5,
00048 KS_E_LATIN7=6,
00049 KS_E_LATIN8=7,
00050 KS_E_LATIN9=8,
00051 KS_E_LATIN13=9,
00052 KS_E_LATIN15=10,
00053 KS_E_UTF8=11,
00054 KS_E_KOI8R=12,
00055 KS_E_KOI8U=13,
00056 KS_E_CP1251=14,
00057 KS_E_CP1255=15
00058 };
00059
00060 enum KSpellClients {
00061 KS_CLIENT_ISPELL=0,
00062 KS_CLIENT_ASPELL=1,
00063 KS_CLIENT_HSPELL=2,
00064 KS_CLIENT_ZEMBEREK=3
00065 };
00066
00087 class KDEUI_EXPORT KSpellConfig : public QWidget
00088 {
00089 Q_OBJECT
00090
00091 public:
00103 KSpellConfig( QWidget *parent=0, const char *name=0,
00104 KSpellConfig *spellConfig=0, bool addHelpButton = true );
00105
00106 KSpellConfig( const KSpellConfig & );
00107
00112 virtual ~KSpellConfig();
00113
00114 void operator=( const KSpellConfig &ksc );
00115
00134 void fillDicts( QComboBox* box, QStringList* dictionaries = 0 );
00135
00150 void setIgnoreList( QStringList _ignorelist );
00151
00157 void setReplaceAllList( QStringList _replaceAllList );
00158
00164 void setNoRootAffix( bool );
00165
00171 void setRunTogether( bool );
00172
00176 void setDictionary( const QString qs );
00177 void setDictFromList( bool dfl );
00178 //void setPersonalDict (const char *s);
00179
00183 void setEncoding( int enctype );
00184 void setClient( int client );
00185
00189 bool noRootAffix() const;
00190 bool runTogether() const;
00191 const QString dictionary() const;
00192 bool dictFromList() const;
00193 //QString personalDict () const;
00194 int encoding() const;
00195 QStringList ignoreList() const;
00196 QStringList replaceAllList() const;
00197
00198 int client() const;
00199
00205 bool writeGlobalSettings();
00206
00207 bool readGlobalSettings();
00208 protected:
00209 void fillInDialog();
00210
00224 bool interpret( QString &fname, QString &lname, QString &hname );
00225
00226
00227 public slots:
00236 void activateHelp( void );
00237
00238
00239 protected slots:
00243 void sHelp();
00244 //void sBrowseDict();
00245 //void sBrowsePDict();
00246 void sNoAff( bool );
00247 void sRunTogether( bool );
00248 void sDictionary( bool );
00249 void sPathDictionary( bool );
00250 void sSetDictionary( int );
00251 void sChangeEncoding( int );
00252 void sChangeClient( int );
00253 //void textChanged1 (const char *);
00254 //void textChanged2 (const char *);
00255
00256 protected:
00257 // The options
00258 int enc; // 1 ==> -Tlatin1
00259 bool bnorootaffix; // -m
00260 bool bruntogether; // -B
00261 bool dictfromlist;
00262 bool nodialog;
00263 QString qsdict; // -d [dict]
00264 QString qspdict; // -p [dict]
00265 QStringList ignorelist;
00266 enum {rdictlist=3, rencoding=4, rhelp=6};
00267 KConfig *kc;
00268 int iclient; // defaults to ispell, may be aspell, too
00269
00270 QCheckBox *cb1, *cb2;
00271 //KLineEdit *kle1, *kle2;
00272 //QButtonGroup *dictgroup;
00273 //QRadioButton *dictlistbutton, *dicteditbutton;
00274 QLabel *dictlist;
00275 QComboBox *dictcombo, *encodingcombo, *clientcombo;
00276 //QPushButton *browsebutton1;
00277 QStringList langfnames;
00278
00279 signals:
00280 void configChanged();
00281
00282 private:
00283 KSpellConfigPrivate *d;
00284 void getAvailDictsIspell();
00285 void getAvailDictsAspell();
00286 };
00287
00288 #endif // KDELIBS_KSCONFIG_H
00289
00290
00291
00292
00293