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