kdeui Library API Documentation

ksconfig.h

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., 59 Temple Place - Suite 330,
00016    Boston, MA 02111-1307, USA.
00017 */
00018 #ifndef __KSCONFIG_H__
00019 #define __KSCONFIG_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 KSpellConfigPrivate;
00031 
00032 // Should be replaced by the charset strings
00033 // because the config file would be more stable
00034 // when inserting entries in the list
00035 enum Encoding {
00036   KS_E_ASCII=0,
00037   KS_E_LATIN1=1,
00038   KS_E_LATIN2=2,
00039   KS_E_LATIN3=3,
00040   KS_E_LATIN4=4,
00041   KS_E_LATIN5=5,
00042   KS_E_LATIN7=6,
00043   KS_E_LATIN8=7,
00044   KS_E_LATIN9=8,
00045   KS_E_LATIN13=9,
00046   KS_E_LATIN15=10,
00047   KS_E_UTF8=11,
00048   KS_E_KOI8R=12,
00049   KS_E_KOI8U=13,
00050   KS_E_CP1251=14,
00051   KS_E_CP1255=15
00052 };
00053 
00054 enum KSpellClients {
00055   KS_CLIENT_ISPELL=0,
00056   KS_CLIENT_ASPELL=1,
00057   KS_CLIENT_HSPELL=2
00058 };
00059 
00081 class KSpellConfig : public QWidget
00082 {
00083   Q_OBJECT
00084 
00085   public:
00097     KSpellConfig( QWidget *parent=0, const char *name=0,
00098           KSpellConfig *spellConfig=0, bool addHelpButton = true );
00099 
00100     KSpellConfig( const KSpellConfig & );
00101 
00106     virtual ~KSpellConfig();
00107 
00108     void operator=( const KSpellConfig &ksc );
00109 
00128     void fillDicts( QComboBox* box, QStringList* dictionaries = 0 );
00129 
00144     void setIgnoreList( QStringList _ignorelist );
00145 
00151     void setReplaceAllList( QStringList _replaceAllList );
00152 
00158     void setNoRootAffix( bool );
00159 
00165     void setRunTogether( bool );
00166 
00170     void setDictionary( const QString qs );
00171     void setDictFromList( bool dfl );
00172     //void setPersonalDict (const char *s);
00173 
00177     void setEncoding( int enctype );
00178     void setClient( int client );
00179 
00183     bool noRootAffix() const;
00184     bool runTogether() const;
00185     const QString dictionary() const;
00186     bool dictFromList() const;
00187     //QString personalDict () const;
00188     int encoding() const;
00189     QStringList ignoreList() const;
00190     QStringList replaceAllList() const;
00191 
00192     int client() const; //see enums at top of file
00193 
00199     bool writeGlobalSettings();
00200 
00201     bool readGlobalSettings();
00202   protected:
00203     void fillInDialog();
00204 
00214     bool interpret( QString &fname, QString &lname, QString &hname );
00215 
00216 
00217   public slots:
00226     void activateHelp( void );
00227 
00228 
00229   protected slots:
00233     void sHelp();
00234     //void sBrowseDict();
00235     //void sBrowsePDict();
00236     void sNoAff( bool );
00237     void sRunTogether( bool );
00238     void sDictionary( bool );
00239     void sPathDictionary( bool );
00240     void sSetDictionary( int );
00241     void sChangeEncoding( int );
00242     void sChangeClient( int );
00243     //void textChanged1 (const char *);
00244     //void textChanged2 (const char *);
00245 
00246   protected:
00247     // The options
00248     int enc;            //1 ==> -Tlatin1
00249     bool bnorootaffix;      // -m
00250     bool bruntogether;      // -B
00251     bool dictfromlist;
00252     bool nodialog;
00253     QString qsdict;     // -d [dict]
00254     QString qspdict;        // -p [dict]
00255     QStringList ignorelist;
00256     enum {rdictlist=3, rencoding=4, rhelp=6};
00257     KConfig *kc;
00258     int iclient;            // defaults to ispell, may be aspell, too
00259 
00260     QCheckBox *cb1, *cb2;
00261     //KLineEdit *kle1, *kle2;
00262     //QButtonGroup *dictgroup;
00263     //QRadioButton *dictlistbutton, *dicteditbutton;
00264     QLabel *dictlist;
00265     QComboBox *dictcombo, *encodingcombo, *clientcombo;
00266     //QPushButton *browsebutton1;
00267     QStringList langfnames;
00268 
00269 signals:
00270     void configChanged();
00271 
00272 private:
00273     KSpellConfigPrivate *d;
00274     void getAvailDictsIspell();
00275     void getAvailDictsAspell();
00276 };
00277 
00278 #endif
00279 
00280 
00281 
00282 
00283 
KDE Logo
This file is part of the documentation for kdeui Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Sep 23 17:11:55 2004 by doxygen 1.3.8-20040913 written by Dimitri van Heesch, © 1997-2003