| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KSpellConfig Class Reference

A configuration class/dialog for KSpell. More...

`#include <ksconfig.h>`

Inheritance diagram for KSpellConfig:

[legend]
Collaboration diagram for KSpellConfig:

[legend]
List of all members.

## Public Slots
void | activateHelp (void)
## Signals
void | configChanged ()
## Public Member Functions
| KSpellConfig (QWidget *parent=0, const char *name=0, KSpellConfig *spellConfig=0, bool addHelpButton=true)
| KSpellConfig (const KSpellConfig &)
virtual | ~KSpellConfig ()
void | operator= (const KSpellConfig &ksc)
void | fillDicts (QComboBox *box, QStringList *dictionaries=0)
void | setIgnoreList (QStringList _ignorelist)
void | setReplaceAllList (QStringList _replaceAllList)
void | setNoRootAffix (bool)
void | setRunTogether (bool)
void | setDictionary (const QString qs)
void | setDictFromList (bool dfl)
void | setEncoding (int enctype)
void | setClient (int client)
bool | noRootAffix () const
bool | runTogether () const
const QString | dictionary () const
bool | dictFromList () const
int | encoding () const
QStringList | ignoreList () const
QStringList | replaceAllList () const
int | client () const
bool | writeGlobalSettings ()
bool | readGlobalSettings ()
## Protected Types
enum | { rdictlist = 3, rencoding = 4, rhelp = 6 }
## Protected Slots
void | sHelp ()
void | sNoAff (bool)
void | sRunTogether (bool)
void | sDictionary (bool)
void | sPathDictionary (bool)
void | sSetDictionary (int)
void | sChangeEncoding (int)
void | sChangeClient (int)
## Protected Member Functions
void | fillInDialog ()
bool | interpret (QString &fname, QString &lname, QString &hname)
## Protected Attributes
int | enc
bool | bnorootaffix
bool | bruntogether
bool | dictfromlist
bool | nodialog
QString | qsdict
QString | qspdict
QStringList | ignorelist
KConfig * | kc
int | iclient
QCheckBox * | cb1
QCheckBox * | cb2
QLabel * | dictlist
QComboBox * | dictcombo
QComboBox * | encodingcombo
QComboBox * | clientcombo
QStringList | langfnames

## Detailed Description

A configuration class/dialog for KSpell.

It contains all of the options settings.The options are set to default values by the constructor and can be reset either by using the public interface or by using KSpellConfig as a widget in a dialog (or, preferably a tabbed dialog using KDialogBase) and letting the user change the settings. This way an application that uses KSpell can either rely on the default settings (in the simplest case), offer a dialog to configure KSpell, or offer a dialog to configure KSpell for this app only (in which case, the application should save the settings for use next time it is run). This last option might be useful in an email program, for example, where people may be writing in a language different from that used for writing papers in their word processor.

Author:
  David Sweet <dsweet@kde.org>

Version:
  Id
    ksconfig.h 345236 2004-09-09 15:23:55Z dfaure

See also:
  KSpell

Definition at line 83 of file ksconfig.h.

## Constructor & Destructor Documentation

KSpellConfig::KSpellConfig | ( | QWidget * | parent = `0`,
|  | const char * | name = `0`,
|  | KSpellConfig * | spellConfig = `0`,
|  | bool | addHelpButton = `true`
| ) |

  | Constructs a KSpellConfig with default or custom settings. Parameters:
  | parent | Parent of the widget.
  | name | Widget name.
  | spellConfig | Predefined configuration. If this parameter is 0, a default configuration will be used.
  | addHelpButton | Enabled or hides a help button. See activateHelp for more information.
Definition at line 69 of file ksconfig.cpp. References QGridLayout::addMultiCellWidget(), QGridLayout::addWidget(), KGlobal::config(), QComboBox::insertItem(), setDictionary(), setIgnoreList(), QComboBox::setInsertionPolicy(), setNoRootAffix(), setRunTogether(), and sHelp().

KSpellConfig::~KSpellConfig | ( |  | ) | `[virtual]`

| Deconstructor. Deletes private class. Definition at line 166 of file ksconfig.cpp.

## Member Function Documentation

void KSpellConfig::fillDicts | ( | QComboBox * | box,
|  | QStringList * | dictionaries = `0`
| ) |

  | Get the translated dictionary names and, optionally, the corresponding internal dictionary names. Fills `box` with the human readable, translated dictionary names and selects the currently used dictionary (this will be the global dictionary if you call fillDicts directly after the constructor). If `dictionaries` isn't 0 then `dictionaries` will be filled with the corresponding internal dictionary names that are necessary to set the dictionary with setDictionary. Parameters:
  | box | Will be filled with the translated dictionary names.
  | dictionaries | Will be filled with the internal dictionary names.
Since: 3.2 Definition at line 570 of file ksconfig.cpp. References QString::arg(), QFileInfo::dirPath(), endl(), QString::endsWith(), QFileInfo::exists(), QFileInfo::filePath(), interpret(), QFileInfo::isDir(), kdDebug(), QString::length(), QString::remove(), and QFileInfo::setFile().

void KSpellConfig::setIgnoreList | ( | QStringList | _ignorelist | ) |

| The `_ignorelist` contains words you'd like KSpell to ignore when it is spellchecking. When you get a KSpellConfig object back from KSpell (using KSpell::kcConfig()), the `_ignorelist` contains whatever was put in by you plus any words the user has chosen to ignore via the dialog box. It may be useful to save this list with the document being edited to facilitate quicker future spellchecking. Definition at line 962 of file ksconfig.cpp. Referenced by KSpell::ksConfig(), and KSpellConfig().

void KSpellConfig::setReplaceAllList | ( | QStringList | _replaceAllList | ) |

| The `_replaceAllList` contains word you like that replace word. Be careful that this list contains word which is replaced and new word. Definition at line 975 of file ksconfig.cpp. Referenced by KSpell::ksConfig().

void KSpellConfig::setNoRootAffix | ( | bool |  | ) |

| Set an ISpell option. If `true`, don't create root-affix combinations. Definition at line 729 of file ksconfig.cpp. References QCheckBox::setChecked(). Referenced by KSpellConfig().

void KSpellConfig::setRunTogether | ( | bool |  | ) |

| Set an ISpell option. If `true`, treat run-together words a valid. Definition at line 738 of file ksconfig.cpp. References QCheckBox::setChecked(). Referenced by KSpellConfig().

void KSpellConfig::setDictionary | ( | const QString | qs | ) |

| Set the name of the dictionary to use. Definition at line 747 of file ksconfig.cpp. References QString::find(), QString::length(), QString::remove(), and QComboBox::setCurrentItem(). Referenced by KSpellConfig().

bool KSpellConfig::noRootAffix | ( |  | ) | const

| Options reading routines. Definition at line 807 of file ksconfig.cpp. Referenced by writeGlobalSettings().

bool KSpellConfig::writeGlobalSettings | ( |  | ) |

| Call this method before this class is deleted if you want the settings you have (or the user has) chosen to become the global, default settings. Definition at line 194 of file ksconfig.cpp. References noRootAffix(), KConfigBase::sync(), and KConfigBase::writeEntry().

bool KSpellConfig::interpret | ( | QString & | fname,
|  | QString & | lname,
|  | QString & | hname
| ) | `[protected]`

  | This takes a dictionary file name and provides both a language abbreviation appropriate for the $LANG variable, and a human-readable name. It also truncates ".aff" at the end of fname. Parameters:
  | fname | the dictionary name file (input)
  | lname | the language abbreviation, such as de for German (output)
  | hname | the human-readable name, such as Deutsch (output)
  Returns: true if
      lname.data()==$LANG
Definition at line 243 of file ksconfig.cpp. References endl(), QString::endsWith(), QString::find(), QString::isEmpty(), kdDebug(), QString::left(), QString::length(), KGlobal::locale(), QString::mid(), QString::remove(), QString::right(), QString::truncate(), KLocale::twoAlphaToCountryName(), and KLocale::twoAlphaToLanguageName(). Referenced by fillDicts().

void KSpellConfig::activateHelp | ( | void |  | ) | `[slot]`

| Use this function to activate the help information for this widget. The function is particulary useful if the help button is not displayed as specified by the constructor. Normally you want to hide the help button if this widget is embedded into a larger dialog box that has its own help button. See kedit (optiondialog.cpp) for an example Definition at line 922 of file ksconfig.cpp. References sHelp().

void KSpellConfig::sHelp | ( |  | ) | `[protected, slot]`

| Invokes the help documentation for kspell. Definition at line 927 of file ksconfig.cpp. Referenced by activateHelp(), and KSpellConfig().

The documentation for this class was generated from the following files:

- ksconfig.h
- ksconfig.cpp

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:22:13 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003