lib Library API Documentation

KOSpellConfig Class Reference

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

#include <koSconfig.h>

Inheritance diagram for KOSpellConfig:

QWidget List of all members.

Public Slots

void activateHelp (void)

Signals

void configChanged ()

Public Member Functions

 KOSpellConfig (QWidget *parent=0, const char *name=0, KOSpellConfig *spellConfig=0, bool addHelpButton=true)
 KOSpellConfig (const KOSpellConfig &)
void operator= (const KOSpellConfig &ksc)
void setIgnoreList (QStringList _ignorelist)
void setReplaceAllList (QStringList _replaceAllList)
void setNoRootAffix (bool)
void setRunTogether (bool)
void setDictionary (const QString &qs)
void setDictFromList (bool dfl)
void setIgnoreCase (bool b)
void setIgnoreAccent (bool b)
void setSpellWordWithNumber (bool b)
void setDontCheckTitleCase (bool _b)
void setDontCheckUpperWord (bool _b)
void setEncoding (int enctype)
void setClient (int client)
bool noRootAffix () const
bool runTogether () const
const QString dictionary () const
bool dictFromList () const
bool ignoreCase () const
bool ignoreAccent () const
int encoding () const
bool spellWordWithNumber () const
QStringList ignoreList () const
QStringList replaceAllList () const
bool dontCheckTitleCase () const
bool dontCheckUpperWord () const
int client () const
bool writeGlobalSettings ()

Static Public Member Functions

QStringList listOfAspellLanguages ()
QStringList listOfLanguageFileName ()
QString fileNameFromLanguage (const QString &_lang)
QString languageFromFileName (const QString &_lang)
int indexFromLanguageFileName (const QString &name)

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)
void slotIgnoreCase (bool)
void slotIgnoreAccent (bool)
void slotSpellWordWithNumber (bool b)
void slotDontSpellCheckUpperWord (bool)
void slotDontCheckTitleCase (bool)

Protected Member Functions

void fillInDialog ()
bool readGlobalSettings ()
QString getLanguage (int i)
virtual void showEvent (QShowEvent *)

Static Protected Member Functions

bool interpret (QString &fname, QString &lname, QString &hname)

Protected Attributes

int enc
bool bnorootaffix
bool bruntogether
bool dictfromlist
bool nodialog
bool m_bIgnoreCase
bool m_bIgnoreAccent
bool m_bSpellWordWithNumber
bool m_bDontCheckUpperWord
bool m_bDontCheckTitleCase
QString qsdict
QString qspdict
QStringList ignorelist
KConfig * kc
int iclient
QCheckBoxcb1
QCheckBoxcb2
QLabeldictlist
QComboBoxdictcombo
QComboBoxencodingcombo
QComboBoxclientcombo
QCheckBoxcbIgnoreCase
QCheckBoxcbIgnoreAccent
QCheckBoxcbSpellWordWithNumber
QCheckBoxcbDontCheckUpperWord
QCheckBoxcbDontCheckTitleCase
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>
See also:
KSpell

Definition at line 80 of file koSconfig.h.


Constructor & Destructor Documentation

KOSpellConfig::KOSpellConfig QWidget parent = 0,
const char *  name = 0,
KOSpellConfig 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 83 of file koSconfig.cpp.

References client(), dictFromList(), dictionary(), dontCheckTitleCase(), dontCheckUpperWord(), encoding(), ignoreAccent(), ignoreCase(), ignoreList(), KOSpellConfig(), noRootAffix(), replaceAllList(), runTogether(), setDictionary(), setIgnoreList(), setNoRootAffix(), setReplaceAllList(), setRunTogether(), and spellWordWithNumber().

Referenced by KOSpellConfig().


Member Function Documentation

void KOSpellConfig::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 824 of file koSconfig.cpp.

References setIgnoreList().

Referenced by KOSpellConfig(), and setIgnoreList().

void KOSpellConfig::setReplaceAllList QStringList  _replaceAllList  ) 
 

The _replaceAllList contains word you like that replace word.

Becarefull this list contains word which is replaced and new word.

Definition at line 849 of file koSconfig.cpp.

References setReplaceAllList().

Referenced by KOSpellConfig(), and setReplaceAllList().

void KOSpellConfig::setNoRootAffix bool   ) 
 

Set an ISpell option.

If true, don't create root-affix combinations.

Definition at line 623 of file koSconfig.cpp.

References setNoRootAffix().

Referenced by KOSpellConfig(), and setNoRootAffix().

void KOSpellConfig::setRunTogether bool   ) 
 

Set an ISpell option.

If true, treat run-together words a valid.

Definition at line 631 of file koSconfig.cpp.

References setRunTogether().

Referenced by KOSpellConfig(), and setRunTogether().

void KOSpellConfig::setDictionary const QString qs  ) 
 

Set the name of the dictionary to use.

Definition at line 639 of file koSconfig.cpp.

References interpret(), and setDictionary().

Referenced by KOSpellConfig(), and setDictionary().

bool KOSpellConfig::noRootAffix  )  const
 

Options reading routines.

Definition at line 696 of file koSconfig.cpp.

Referenced by KOSpellConfig(), and writeGlobalSettings().

bool KOSpellConfig::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 259 of file koSconfig.cpp.

References noRootAffix().

bool KOSpellConfig::interpret QString fname,
QString lname,
QString hname
[static, protected]
 

This takes a dictionary file name (fname) and returns a language abbreviation (lname; like de for German), appropriate for the $LANG variable, and a human-readble name (hname; like "Deutsch").

It also truncates ".aff" at the end of fname.

TRUE is returned if lname.data()==$LANG

Definition at line 347 of file koSconfig.cpp.

References interpret().

Referenced by interpret(), and setDictionary().

void KOSpellConfig::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 795 of file koSconfig.cpp.


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for lib Library Version 1.3.5.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Nov 17 06:54:22 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003