ksconfig.h
00001 /* This file is part of the KDE libraries 00002 Copyright (C) 1997 David Sweet <dsweet@kde.org> 00003 Copyright (C) 2007 Kevin Kofler <Kevin@tigcc.ticalc.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License version 2 as published by the Free Software Foundation. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 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 //void setPersonalDict (const char *s); 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 //QString personalDict () const; 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 //void sBrowseDict(); 00247 //void sBrowsePDict(); 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 //void textChanged1 (const char *); 00256 //void textChanged2 (const char *); 00257 00258 protected: 00259 // The options 00260 int enc; // 1 ==> -Tlatin1 00261 bool bnorootaffix; // -m 00262 bool bruntogether; // -B 00263 bool dictfromlist; 00264 bool nodialog; 00265 QString qsdict; // -d [dict] 00266 QString qspdict; // -p [dict] 00267 QStringList ignorelist; 00268 enum {rdictlist=3, rencoding=4, rhelp=6}; 00269 KConfig *kc; 00270 int iclient; // defaults to ispell, may be aspell, too 00271 00272 QCheckBox *cb1, *cb2; 00273 //KLineEdit *kle1, *kle2; 00274 //QButtonGroup *dictgroup; 00275 //QRadioButton *dictlistbutton, *dicteditbutton; 00276 QLabel *dictlist; 00277 QComboBox *dictcombo, *encodingcombo, *clientcombo; 00278 //QPushButton *browsebutton1; 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