kspell 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 };
00052 
00053 enum KSpellClients {
00054   KS_CLIENT_ISPELL=0,
00055   KS_CLIENT_ASPELL=1
00056 };
00057 
00079 class KSpellConfig : public QWidget
00080 {
00081   Q_OBJECT
00082 
00083   public:
00095     KSpellConfig( QWidget *parent=0, const char *name=0,
00096           KSpellConfig *spellConfig=0, bool addHelpButton = true );
00097 
00098     KSpellConfig (const KSpellConfig &);
00099 
00100     virtual ~KSpellConfig ();
00101 
00102     void operator= (const KSpellConfig &ksc);
00103 
00118     void setIgnoreList (QStringList _ignorelist);
00119 
00125     void setReplaceAllList (QStringList _replaceAllList);
00126 
00132     void setNoRootAffix (bool);
00133 
00139     void setRunTogether(bool);
00140 
00144     void setDictionary (const QString qs);
00145     void setDictFromList (bool dfl);
00146     //void setPersonalDict (const char *s);
00147 
00151     void setEncoding (int enctype);
00152     void setClient (int client);
00153 
00157     bool noRootAffix () const;
00158     bool runTogether() const;
00159     const QString dictionary () const;
00160     bool dictFromList () const;
00161     //QString personalDict () const;
00162     int encoding () const;
00163     QStringList ignoreList () const;
00164     QStringList replaceAllList () const;
00165 
00166     int client () const; //see enums at top of file
00167 
00173     bool writeGlobalSettings ();
00174 
00175   protected:
00176     void fillInDialog();
00177     bool readGlobalSettings();
00178 
00188     bool interpret( QString &fname, QString &lname, QString &hname );
00189 
00190 
00191   public slots:
00200     void activateHelp( void );
00201 
00202 
00203   protected slots:
00204     void sHelp();
00205     //void sBrowseDict();
00206     //void sBrowsePDict();
00207     void sNoAff(bool);
00208     void sRunTogether(bool);
00209     void sDictionary(bool);
00210     void sPathDictionary(bool);
00211     void sSetDictionary (int);
00212     void sChangeEncoding (int);
00213     void sChangeClient (int);
00214     //void textChanged1 (const char *);
00215     //void textChanged2 (const char *);
00216 
00217   protected:
00218     // The options
00219     int enc;            //1 ==> -Tlatin1
00220     bool bnorootaffix;      // -m
00221     bool bruntogether;      // -B
00222     bool dictfromlist;
00223     bool nodialog;
00224     QString qsdict;     // -d [dict]
00225     QString qspdict;        // -p [dict]
00226     QStringList ignorelist;
00227     enum {rdictlist=3, rencoding=4, rhelp=6};
00228     KConfig *kc;
00229     int iclient;            // defaults to ispell, may be aspell, too
00230 
00231     QCheckBox *cb1, *cb2;
00232     //KLineEdit *kle1, *kle2;
00233     //QButtonGroup *dictgroup;
00234     //QRadioButton *dictlistbutton, *dicteditbutton;
00235     QLabel *dictlist;
00236     QComboBox *dictcombo, *encodingcombo, *clientcombo;
00237     //QPushButton *browsebutton1;
00238     QStringList langfnames;
00239 
00240 signals:
00241     void configChanged();
00242 
00243   private:
00244     KSpellConfigPrivate *d;
00245     void getAvailDictsIspell();
00246     void getAvailDictsAspell();
00247 };
00248 
00249 #endif
00250 
00251 
00252 
00253 
00254 
KDE Logo
This file is part of the documentation for kdelibs Version 3.1.0.
Documentation copyright © 1996-2002 the KDE developers.
Generated on Wed Oct 8 12:21:50 2003 by doxygen 1.2.18 written by Dimitri van Heesch, © 1997-2001