\section{KSpell Class Reference}
\label{classKSpell}\index{KSpell@{KSpell}}
{\bf KDE} Spellchecker.  


{\tt \#include $<$kspell.h$>$}

Inheritance diagram for KSpell:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=43pt]{classKSpell__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KSpell:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=231pt]{classKSpell__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum {\bf spell\-Status} \{ \par
{\bf Starting} =  0, 
{\bf Running}, 
{\bf Cleaning}, 
{\bf Finished}, 
\par
{\bf Error}, 
{\bf Crashed}
 \}
\begin{CompactList}\small\item\em Possible states of the spell checker. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf misspelling} (const  {\bf QString} \&originalword, const  {\bf QString\-List} \&suggestions, unsigned int pos)
\begin{CompactList}\small\item\em Emitted whenever a misspelled word is found by {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() or by {\bf check\-Word}{\rm (p.\,\pageref{classKSpell_a7})}(). \item\end{CompactList}\item 
void {\bf corrected} (const  {\bf QString} \&originalword, const  {\bf QString} \&newword, unsigned int pos)
\begin{CompactList}\small\item\em Emitted after the \char`\"{}Replace\char`\"{} or \char`\"{}Replace All\char`\"{} buttons of the dialog was pressed, or if the word was corrected without calling the dialog (i.e., the user previously chose \char`\"{}Replace All\char`\"{} for this word). \item\end{CompactList}\item 
void {\bf ignoreall} (const  {\bf QString} \&originalword)
\begin{CompactList}\small\item\em Emitted when the user pressed \char`\"{}Ignore All\char`\"{} in the dialog. \item\end{CompactList}\item 
void {\bf ignoreword} (const  {\bf QString} \&originalword)
\begin{CompactList}\small\item\em Emitted when the user pressed \char`\"{}Ignore\char`\"{} in the dialog. \item\end{CompactList}\item 
void {\bf addword} (const  {\bf QString} \&originalword)
\begin{CompactList}\small\item\em Emitted when the user pressed \char`\"{}Add\char`\"{} in the dialog. \item\end{CompactList}\item 
void {\bf replaceall} (const  {\bf QString} \&origword, const  {\bf QString} \&replacement)
\begin{CompactList}\small\item\em Emitted when the user pressed \char`\"{}Replace\-All\char`\"{} in the dialog. \item\end{CompactList}\item 
void {\bf ready} ({\bf KSpell} $\ast$)
\begin{CompactList}\small\item\em Emitted after KSpell has verified that ISpell/ASpell is running and working properly. \item\end{CompactList}\item 
void {\bf progress} (unsigned int i)
\begin{CompactList}\small\item\em Emitted during a {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}(). \item\end{CompactList}\item 
void {\bf done} (const  {\bf QString} \&buffer)
\begin{CompactList}\small\item\em Emitted when {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() is done. \item\end{CompactList}\item 
void {\bf done} (bool)
\begin{CompactList}\small\item\em Emitted when {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}() is done. \item\end{CompactList}\item 
void {\bf death} ()
\begin{CompactList}\small\item\em Emitted on terminal errors and after clean up. \item\end{CompactList}\item 
void {\bf dialog3} ()\label{classKSpell_l11}

\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KSpell} ({\bf QWidget} $\ast${\bf parent}, const  {\bf QString} \&caption, {\bf QObject} $\ast$receiver, const  char $\ast$slot, {\bf KSpell\-Config} $\ast$kcs=0, bool progressbar=TRUE, bool modal=FALSE)
\begin{CompactList}\small\item\em Starts the spellchecker. \item\end{CompactList}\item 
{\bf spell\-Status} {\bf status} () const 
\begin{CompactList}\small\item\em Returns the status of KSpell. \item\end{CompactList}\item 
virtual void {\bf clean\-Up} ()
\begin{CompactList}\small\item\em Cleans up ISpell. \item\end{CompactList}\item 
void {\bf set\-Auto\-Delete} (bool \_\-auto\-Delete)
\begin{CompactList}\small\item\em Sets the auto-delete flag. \item\end{CompactList}\item 
virtual bool {\bf check} (const  {\bf QString} \&\_\-buffer, bool usedialog=TRUE)
\begin{CompactList}\small\item\em Spellchecks a buffer of many words in plain text format. \item\end{CompactList}\item 
int {\bf last\-Position} () const 
\begin{CompactList}\small\item\em Returns the position (when using {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}()) or word number (when using {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}()) of the last word checked. \item\end{CompactList}\item 
virtual bool {\bf check\-List} ({\bf QString\-List} $\ast$\_\-wordlist, bool usedialog=TRUE)
\begin{CompactList}\small\item\em Spellchecks a list of words. \item\end{CompactList}\item 
virtual bool {\bf check\-Word} (const  {\bf QString} \&\_\-buffer, bool usedialog=FALSE)
\begin{CompactList}\small\item\em Spellchecks a single word. \item\end{CompactList}\item 
void {\bf hide} ()
\begin{CompactList}\small\item\em Hides the dialog box. \item\end{CompactList}\item 
{\bf QString\-List} {\bf suggestions} () const 
\begin{CompactList}\small\item\em Returns list of suggested word replacements. \item\end{CompactList}\item 
int {\bf dlg\-Result} () const 
\begin{CompactList}\small\item\em Gets the result code of the dialog box. \item\end{CompactList}\item 
void {\bf move\-Dlg} (int x, int y)
\begin{CompactList}\small\item\em Moves the dialog. \item\end{CompactList}\item 
int {\bf height\-Dlg} () const 
\begin{CompactList}\small\item\em Returns the height of the dialog box. \item\end{CompactList}\item 
int {\bf width\-Dlg} () const 
\begin{CompactList}\small\item\em Returns the width of the dialog box. \item\end{CompactList}\item 
{\bf QString} {\bf intermediate\-Buffer} () const 
\begin{CompactList}\small\item\em Returns the partially spellchecked buffer. \item\end{CompactList}\item 
virtual bool {\bf ignore} (const  {\bf QString} \&word)
\begin{CompactList}\small\item\em Tells ISpell/ASpell to ignore this word for the life of this KSpell instance. \item\end{CompactList}\item 
virtual bool {\bf add\-Personal} (const  {\bf QString} \&word)
\begin{CompactList}\small\item\em Adds a word to the user's personal dictionary. \item\end{CompactList}\item 
{\bf KSpell\-Config} {\bf ks\-Config} () const 
\item 
void {\bf set\-Progress\-Resolution} (unsigned res)
\begin{CompactList}\small\item\em Sets the resolution (in percent) of the {\bf progress}{\rm (p.\,\pageref{classKSpell_l7})}() signals. \item\end{CompactList}\item 
virtual {\bf $\sim$KSpell} ()
\begin{CompactList}\small\item\em The destructor instructs ISpell/ASpell to write out the personal dictionary and then terminates ISpell/ASpell. \item\end{CompactList}\item 
void {\bf set\-Ignore\-Upper\-Words} (bool b)
\begin{CompactList}\small\item\em Call {\bf set\-Ignore\-Upper\-Words}{\rm (p.\,\pageref{classKSpell_a20})}(true) to tell the spell-checker to ignore words that are completely uppercase. \item\end{CompactList}\item 
void {\bf set\-Ignore\-Title\-Case} (bool b)
\begin{CompactList}\small\item\em Call {\bf set\-Ignore\-Title\-Case}{\rm (p.\,\pageref{classKSpell_a21})}(true) to tell the spell-checker to ignore words with a 'title' case, i.e. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Public Member Functions}
\begin{CompactItemize}
\item 
int {\bf modal\-Check} ({\bf QString} \&text)
\begin{CompactList}\small\item\em Performs a synchronous spellcheck. \item\end{CompactList}\item 
int {\bf modal\-Check} ({\bf QString} \&text, {\bf KSpell\-Config} $\ast$kcs)
\begin{CompactList}\small\item\em Performs a synchronous spellcheck. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Slots}
\begin{CompactItemize}
\item 
void {\bf KSpell2} ({\bf KProc\-IO} $\ast$)\label{classKSpell_j0}

\item 
void {\bf check\-Word2} ({\bf KProc\-IO} $\ast$)\label{classKSpell_j1}

\item 
void {\bf check\-Word3} ()\label{classKSpell_j2}

\item 
void {\bf check2} ({\bf KProc\-IO} $\ast$)\label{classKSpell_j3}

\item 
void {\bf check\-List2} ()\label{classKSpell_j4}

\item 
void {\bf check\-List3a} ({\bf KProc\-IO} $\ast$)\label{classKSpell_j5}

\item 
void {\bf check\-List\-Replace\-Current} ()\label{classKSpell_j6}

\item 
void {\bf check\-List4} ()\label{classKSpell_j7}

\item 
void {\bf dialog2} (int dlgresult)\label{classKSpell_j8}

\item 
void {\bf check3} ()\label{classKSpell_j9}

\item 
void {\bf slot\-Stop\-Cancel} (int)\label{classKSpell_j10}

\item 
void {\bf ispell\-Exit} ({\bf KProcess} $\ast$)\label{classKSpell_j11}

\item 
void {\bf emit\-Death} ()\label{classKSpell_j12}

\item 
void {\bf ispell\-Errors} ({\bf KProcess} $\ast$, char $\ast$, int)\label{classKSpell_j13}

\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
int {\bf parse\-One\-Response} (const  {\bf QString} \&\_\-buffer, {\bf QString} \&word, {\bf QString\-List} \&sugg)\label{classKSpell_b0}

\item 
{\bf QString} {\bf funny\-Word} (const  {\bf QString} \&word)\label{classKSpell_b1}

\item 
void {\bf dialog} (const  {\bf QString} \&word, {\bf QString\-List} \&sugg, const  char $\ast$\_\-slot)\label{classKSpell_b2}

\item 
{\bf QString} {\bf replacement} () const \label{classKSpell_b3}

\item 
void {\bf set\-Up\-Dialog} (bool reallyusedialogbox=TRUE)\label{classKSpell_b4}

\item 
void {\bf emit\-Progress} ()\label{classKSpell_b5}

\item 
bool {\bf clean\-Fputs} (const  {\bf QString} \&s, bool append\-CR=TRUE)\label{classKSpell_b6}

\item 
bool {\bf clean\-Fputs\-Word} (const  {\bf QString} \&s, bool append\-CR=TRUE)\label{classKSpell_b7}

\item 
void {\bf start\-Ispell} ()\label{classKSpell_b8}

\item 
bool {\bf write\-Personal\-Dictionary} ()\label{classKSpell_b9}

\end{CompactItemize}
\subsection*{Protected Attributes}
\begin{CompactItemize}
\item 
{\bf KProc\-IO} $\ast$ {\bf proc}\label{classKSpell_p0}

\item 
{\bf QWidget} $\ast$ {\bf parent}\label{classKSpell_p1}

\item 
{\bf KSpell\-Config} $\ast$ {\bf ksconfig}\label{classKSpell_p2}

\item 
KSpell\-Dlg $\ast$ {\bf ksdlg}\label{classKSpell_p3}

\item 
{\bf QString\-List} $\ast$ {\bf wordlist}\label{classKSpell_p4}

\item 
QString\-List::Iterator {\bf wl\-It}\label{classKSpell_p5}

\item 
{\bf QString\-List} {\bf ignorelist}\label{classKSpell_p6}

\item 
{\bf QString\-List} {\bf replacelist}\label{classKSpell_p7}

\item 
{\bf QString\-List} {\bf sugg}\label{classKSpell_p8}

\item 
{\bf QText\-Codec} $\ast$ {\bf codec}\label{classKSpell_p9}

\item 
{\bf spell\-Status} {\bf m\_\-status}\label{classKSpell_p10}

\item 
bool {\bf usedialog}\label{classKSpell_p11}

\item 
bool {\bf texmode}\label{classKSpell_p12}

\item 
bool {\bf dlgon}\label{classKSpell_p13}

\item 
bool {\bf personaldict}\label{classKSpell_p14}

\item 
bool {\bf dialogwillprocess}\label{classKSpell_p15}

\item 
bool {\bf progressbar}\label{classKSpell_p16}

\item 
bool {\bf dialogsetup}\label{classKSpell_p17}

\item 
bool {\bf auto\-Delete}\label{classKSpell_p18}

\item 
{\bf QString} {\bf caption}\label{classKSpell_p19}

\item 
{\bf QString} {\bf orig}\label{classKSpell_p20}

\item 
{\bf QString} {\bf origbuffer}\label{classKSpell_p21}

\item 
{\bf QString} {\bf newbuffer}\label{classKSpell_p22}

\item 
{\bf QString} {\bf cwword}\label{classKSpell_p23}

\item 
{\bf QString} {\bf dlgorigword}\label{classKSpell_p24}

\item 
{\bf QString} {\bf dlgreplacement}\label{classKSpell_p25}

\item 
{\bf QString} {\bf dialog3slot}\label{classKSpell_p26}

\item 
int {\bf dlgresult}\label{classKSpell_p27}

\item 
int {\bf trystart}\label{classKSpell_p28}

\item 
int {\bf maxtrystart}\label{classKSpell_p29}

\item 
int {\bf lastpos}\label{classKSpell_p30}

\item 
unsigned int {\bf totalpos}\label{classKSpell_p31}

\item 
unsigned int {\bf lastline}\label{classKSpell_p32}

\item 
unsigned int {\bf posinline}\label{classKSpell_p33}

\item 
unsigned int {\bf lastlastline}\label{classKSpell_p34}

\item 
unsigned int {\bf offset}\label{classKSpell_p35}

\item 
unsigned int {\bf progres}\label{classKSpell_p36}

\item 
unsigned int {\bf curprog}\label{classKSpell_p37}

\item 
bool {\bf modaldlg}
\begin{CompactList}\small\item\em Used for {\bf modal\-Check}{\rm (p.\,\pageref{classKSpell_e0})}. \item\end{CompactList}\end{CompactItemize}
\subsection*{Static Protected Attributes}
\begin{CompactItemize}
\item 
{\bf QString} {\bf modaltext}\label{classKSpell_t0}

\item 
int {\bf modalreturn} = 0\label{classKSpell_t1}

\item 
{\bf QWidget} $\ast$ {\bf modal\-Widget\-Hack} = 0\label{classKSpell_t2}

\item 
{\bf QString\-List} {\bf modal\-List\-Text}\label{classKSpell_t3}

\end{CompactItemize}


\subsection{Detailed Description}
{\bf KDE} Spellchecker. 

A {\bf KDE} programmer's interface to International ISpell 3.1. (GPL 1997) A static method, {\bf modal\-Check}{\rm (p.\,\pageref{classKSpell_e0})}() is provided for convenient access to the spellchecker.

\begin{Desc}
\item[Author:]David Sweet $<${\tt dsweet@kde.org}$>$ \end{Desc}
\begin{Desc}
\item[Version:]\begin{Desc}
\item[Id]{\bf kspell.h}{\rm (p.\,\pageref{kspell_8h})},v 1.42 2002/05/22 22:09:08 coolo Exp \end{Desc}
\end{Desc}
\begin{Desc}
\item[See also:]{\bf KSpell\-Config}{\rm (p.\,\pageref{classKSpellConfig})} \end{Desc}




Definition at line 44 of file kspell.h.

\subsection{Member Enumeration Documentation}
\index{KSpell@{KSpell}!spellStatus@{spellStatus}}
\index{spellStatus@{spellStatus}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}enum {\bf KSpell::spell\-Status}}\label{classKSpell_w6}


Possible states of the spell checker. 

\begin{itemize}
\item {\tt Starting} - After creation of KSpell. \item {\tt Running} - After the ready signal has been emitted. \item {\tt Cleaning} - After {\bf clean\-Up}{\rm (p.\,\pageref{classKSpell_a2})}() has been called. \item {\tt Finished} - After {\bf clean\-Up}{\rm (p.\,\pageref{classKSpell_a2})}() has been completed.\end{itemize}
The following error states exist:

\begin{itemize}
\item {\tt Error} - An error occurred in the {\tt Starting} state. \item {\tt Crashed} - An error occurred in the {\tt Running} state. \end{itemize}


Definition at line 63 of file kspell.h.

Referenced by status().

\subsection{Constructor \& Destructor Documentation}
\index{KSpell@{KSpell}!KSpell@{KSpell}}
\index{KSpell@{KSpell}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSpell::KSpell ({\bf QWidget} $\ast$ {\em parent}, const {\bf QString} \& {\em caption}, {\bf QObject} $\ast$ {\em receiver}, const char $\ast$ {\em slot}, {\bf KSpell\-Config} $\ast$ {\em kcs} = 0, bool {\em progressbar} = TRUE, bool {\em modal} = FALSE)}\label{classKSpell_a0}


Starts the spellchecker. 

KSpell emits {\bf ready}{\rm (p.\,\pageref{classKSpell_l6})}() when it has verified that ISpell/ASpell is working properly. Pass the name of a slot -- do not pass zero! Be sure to call {\bf clean\-Up}{\rm (p.\,\pageref{classKSpell_a2})}() when you are done with KSpell.

If KSpell could not be started correctly, {\bf death}{\rm (p.\,\pageref{classKSpell_l10})}() is emitted.

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em parent}]Parent of {\bf KSpell\-Config}{\rm (p.\,\pageref{classKSpellConfig})} dialog.. \item[{\em caption}]Caption of {\bf KSpell\-Config}{\rm (p.\,\pageref{classKSpellConfig})} dialog. \item[{\em receiver}]Receiver object for the {\bf ready(KSpell $\ast$)}{\rm (p.\,\pageref{classKSpell_l6})} signal. \item[{\em slot}]Receiver's slot, will be connected to the {\bf ready(KSpell $\ast$)}{\rm (p.\,\pageref{classKSpell_l6})} signal. \item[{\em kcs}]Configuration for KSpell. \item[{\em progressbar}]Indicates if progress bar should be shown. \item[{\em modal}]Indicates modal or non-modal dialog. \end{description}
\end{Desc}


Definition at line 88 of file kspell.cpp.

References QText\-Codec::codec\-For\-Name(), QObject::connect(), KSpell\-Config::encoding(), KSpell\-Config::ignore\-List(), modaldlg, QText\-Codec::name(), ready(), and KSpell\-Config::replace\-All\-List().

Referenced by modal\-Check().\index{KSpell@{KSpell}!~KSpell@{$\sim$KSpell}}
\index{~KSpell@{$\sim$KSpell}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KSpell::$\sim${\bf KSpell} ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a19}


The destructor instructs ISpell/ASpell to write out the personal dictionary and then terminates ISpell/ASpell. 



Definition at line 1135 of file kspell.cpp.

\subsection{Member Function Documentation}
\index{KSpell@{KSpell}!status@{status}}
\index{status@{status}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf spell\-Status} KSpell::status () const\hspace{0.3cm}{\tt  [inline]}}\label{classKSpell_a1}


Returns the status of KSpell. 

\begin{Desc}
\item[See also:]{\bf spell\-Status()}{\rm (p.\,\pageref{classKSpell_w6})} \end{Desc}


Definition at line 91 of file kspell.h.

References spell\-Status.

Referenced by modal\-Check().\index{KSpell@{KSpell}!cleanUp@{cleanUp}}
\index{cleanUp@{cleanUp}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::clean\-Up ()\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a2}


Cleans up ISpell. 

Write out the personal dictionary and close ISpell's stdin. A {\bf death}{\rm (p.\,\pageref{classKSpell_l10})}() signal will be emitted when the cleanup is complete, but this method will return immediately. 

Definition at line 1157 of file kspell.cpp.

References KProcess::close\-Stdin().\index{KSpell@{KSpell}!setAutoDelete@{setAutoDelete}}
\index{setAutoDelete@{setAutoDelete}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::set\-Auto\-Delete (bool {\em \_\-auto\-Delete})\hspace{0.3cm}{\tt  [inline]}}\label{classKSpell_a3}


Sets the auto-delete flag. 

If this is set, the KSpell object is automatically deleted after emitting {\bf death}{\rm (p.\,\pageref{classKSpell_l10})}(). 

Definition at line 106 of file kspell.h.\index{KSpell@{KSpell}!check@{check}}
\index{check@{check}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSpell::check (const {\bf QString} \& {\em \_\-buffer}, bool {\em usedialog} = TRUE)\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a4}


Spellchecks a buffer of many words in plain text format. 

The {\tt \_\-buffer} is not modified. The signal {\bf done}{\rm (p.\,\pageref{classKSpell_l8})}() will be sent when {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() is finished and the argument will be a spell-corrected version of {\tt \_\-buffer}.

The spell check may be stopped by the user before the entire buffer has been checked. You can check {\bf last\-Position}{\rm (p.\,\pageref{classKSpell_a5})}() to see how far in {\tt \_\-buffer} {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() reached before stopping. 

Definition at line 868 of file kspell.cpp.

References QString::at(), done(), KProc\-IO::fputs(), QString::length(), QString::mid(), and QString::right().\index{KSpell@{KSpell}!lastPosition@{lastPosition}}
\index{lastPosition@{lastPosition}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSpell::last\-Position () const\hspace{0.3cm}{\tt  [inline]}}\label{classKSpell_a5}


Returns the position (when using {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}()) or word number (when using {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}()) of the last word checked. 



Definition at line 128 of file kspell.h.\index{KSpell@{KSpell}!checkList@{checkList}}
\index{checkList@{checkList}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSpell::check\-List ({\bf QString\-List} $\ast$ {\em \_\-wordlist}, bool {\em usedialog} = TRUE)\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a6}


Spellchecks a list of words. 

{\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}() is more flexible than {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}(). You could parse any type of document (HTML, Te\-X, etc.) into a list of spell-checkable words and send the list to {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}(). Sending a marked-up document to {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() would result in the mark-up tags being spell checked. 

Definition at line 689 of file kspell.cpp.

References KProc\-IO::fputs().\index{KSpell@{KSpell}!checkWord@{checkWord}}
\index{checkWord@{checkWord}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSpell::check\-Word (const {\bf QString} \& {\em \_\-buffer}, bool {\em usedialog} = FALSE)\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a7}


Spellchecks a single word. 

{\bf check\-Word()}{\rm (p.\,\pageref{classKSpell_a7})} is the most flexible function. Some applications might need this flexibility but will sacrifice speed when checking large numbers of words. Consider {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}() for checking many words.

Use this method for implementing \char`\"{}online\char`\"{} spellchecking (i.e., spellcheck as-you-type).

{\bf check\-Word()}{\rm (p.\,\pageref{classKSpell_a7})} returns {\tt false} if {\tt buffer} is not a single word (e.g. if it contains white space), otherwise it returns {\tt true};

If {\tt usedialog} is set to {\tt true}, KSpell will open the standard dialog if the word is not found. The dialog results can be queried by using {\bf dlg\-Result}{\rm (p.\,\pageref{classKSpell_a10})}() and replacement().

The signal {\bf corrected}{\rm (p.\,\pageref{classKSpell_l1})}() is emitted when the check is complete. You can look at {\bf suggestions}{\rm (p.\,\pageref{classKSpell_a9})}() to see what the suggested replacements were. 

Definition at line 487 of file kspell.cpp.

References QString::find(), KProc\-IO::fputs(), QString::is\-Empty(), and QString::simplify\-White\-Space().\index{KSpell@{KSpell}!hide@{hide}}
\index{hide@{hide}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::hide ()}\label{classKSpell_a8}


Hides the dialog box. 

You'll need to do this when you are done with {\bf check\-Word}{\rm (p.\,\pageref{classKSpell_a7})}(); 

Definition at line 198 of file kspell.cpp.\index{KSpell@{KSpell}!suggestions@{suggestions}}
\index{suggestions@{suggestions}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString\-List} KSpell::suggestions () const\hspace{0.3cm}{\tt  [inline]}}\label{classKSpell_a9}


Returns list of suggested word replacements. 

After calling {\bf check\-Word}{\rm (p.\,\pageref{classKSpell_a7})}() (an in response to a misspelled() signal you can use this to get the list of suggestions (if any were available). 

Definition at line 182 of file kspell.h.\index{KSpell@{KSpell}!dlgResult@{dlgResult}}
\index{dlgResult@{dlgResult}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSpell::dlg\-Result () const\hspace{0.3cm}{\tt  [inline]}}\label{classKSpell_a10}


Gets the result code of the dialog box. 

After calling check\-Word, you can use this to get the dialog box's result code. The possible values are (from {\bf kspelldlg.h}{\rm (p.\,\pageref{kspelldlg_8h})}): \begin{itemize}
\item KS\_\-CANCEL \item KS\_\-REPLACE \item KS\_\-REPLACEALL \item KS\_\-IGNORE \item KS\_\-IGNOREALL \item KS\_\-ADD \item KS\_\-STOP \end{itemize}


Definition at line 200 of file kspell.h.\index{KSpell@{KSpell}!moveDlg@{moveDlg}}
\index{moveDlg@{moveDlg}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::move\-Dlg (int {\em x}, int {\em y})}\label{classKSpell_a11}


Moves the dialog. 

If the dialog is not currently visible, it will be placed at this position when it becomes visible. Use this to get the dialog out of the way of a highlighted misspelled word in a document. 

Definition at line 1220 of file kspell.cpp.

References QWidget::map\-To\-Global(), QPoint::x(), and QPoint::y().\index{KSpell@{KSpell}!heightDlg@{heightDlg}}
\index{heightDlg@{heightDlg}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSpell::height\-Dlg () const}\label{classKSpell_a12}


Returns the height of the dialog box. 



Definition at line 200 of file kspell.cpp.\index{KSpell@{KSpell}!widthDlg@{widthDlg}}
\index{widthDlg@{widthDlg}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSpell::width\-Dlg () const}\label{classKSpell_a13}


Returns the width of the dialog box. 



Definition at line 201 of file kspell.cpp.\index{KSpell@{KSpell}!intermediateBuffer@{intermediateBuffer}}
\index{intermediateBuffer@{intermediateBuffer}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QString} KSpell::intermediate\-Buffer () const\hspace{0.3cm}{\tt  [inline]}}\label{classKSpell_a14}


Returns the partially spellchecked buffer. 

You might want the full buffer in its partially-checked state. 

Definition at line 227 of file kspell.h.\index{KSpell@{KSpell}!ignore@{ignore}}
\index{ignore@{ignore}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSpell::ignore (const {\bf QString} \& {\em word})\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a15}


Tells ISpell/ASpell to ignore this word for the life of this KSpell instance. 

\begin{Desc}
\item[Returns:]false if {\tt word} is not a word or there was an error communicating with ISpell/ASpell. \end{Desc}


Definition at line 424 of file kspell.cpp.

References QString::find(), KProc\-IO::fputs(), QString::is\-Empty(), QString::prepend(), and QString::simplify\-White\-Space().\index{KSpell@{KSpell}!addPersonal@{addPersonal}}
\index{addPersonal@{addPersonal}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KSpell::add\-Personal (const {\bf QString} \& {\em word})\hspace{0.3cm}{\tt  [virtual]}}\label{classKSpell_a16}


Adds a word to the user's personal dictionary. 

\begin{Desc}
\item[Returns:]false if {\tt word} is not a word or there was an error communicating with ISpell/ASpell. \end{Desc}


Definition at line 405 of file kspell.cpp.

References QString::find(), KProc\-IO::fputs(), QString::is\-Empty(), QString::prepend(), and QString::simplify\-White\-Space().\index{KSpell@{KSpell}!ksConfig@{ksConfig}}
\index{ksConfig@{ksConfig}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf KSpell\-Config} KSpell::ks\-Config () const}\label{classKSpell_a17}


\begin{Desc}
\item[Returns:]the {\bf KSpell\-Config}{\rm (p.\,\pageref{classKSpellConfig})} object being used by this KSpell instance. \end{Desc}


Definition at line 1150 of file kspell.cpp.

References KSpell\-Config::set\-Ignore\-List(), and KSpell\-Config::set\-Replace\-All\-List().\index{KSpell@{KSpell}!setProgressResolution@{setProgressResolution}}
\index{setProgressResolution@{setProgressResolution}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::set\-Progress\-Resolution (unsigned {\em res})}\label{classKSpell_a18}


Sets the resolution (in percent) of the {\bf progress}{\rm (p.\,\pageref{classKSpell_l7})}() signals. 

E.g. {\bf set\-Progress\-Resolution}{\rm (p.\,\pageref{classKSpell_a18})} (10) instructs KSpell to send progress signals (at most) every 10\% (10\%, 20\%, 30\%...). The default is 10\%. \index{KSpell@{KSpell}!modalCheck@{modalCheck}}
\index{modalCheck@{modalCheck}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSpell::modal\-Check ({\bf QString} \& {\em text})\hspace{0.3cm}{\tt  [static]}}\label{classKSpell_e0}


Performs a synchronous spellcheck. 

This method does not return until spellchecking is done or canceled. Your application's GUI will still be updated, however. 

Definition at line 1244 of file kspell.cpp.\index{KSpell@{KSpell}!modalCheck@{modalCheck}}
\index{modalCheck@{modalCheck}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KSpell::modal\-Check ({\bf QString} \& {\em text}, {\bf KSpell\-Config} $\ast$ {\em kcs})\hspace{0.3cm}{\tt  [static]}}\label{classKSpell_e1}


Performs a synchronous spellcheck. 

This method does not return until spellchecking is done or canceled. Your application's GUI will still be updated, however.

This overloaded method uses the spell-check configuration passed as parameter. 

Definition at line 1250 of file kspell.cpp.

References KSpell(), and status().\index{KSpell@{KSpell}!setIgnoreUpperWords@{setIgnoreUpperWords}}
\index{setIgnoreUpperWords@{setIgnoreUpperWords}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::set\-Ignore\-Upper\-Words (bool {\em b})}\label{classKSpell_a20}


Call {\bf set\-Ignore\-Upper\-Words}{\rm (p.\,\pageref{classKSpell_a20})}(true) to tell the spell-checker to ignore words that are completely uppercase. 

They are spell-checked by default. 

Definition at line 1227 of file kspell.cpp.\index{KSpell@{KSpell}!setIgnoreTitleCase@{setIgnoreTitleCase}}
\index{setIgnoreTitleCase@{setIgnoreTitleCase}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::set\-Ignore\-Title\-Case (bool {\em b})}\label{classKSpell_a21}


Call {\bf set\-Ignore\-Title\-Case}{\rm (p.\,\pageref{classKSpell_a21})}(true) to tell the spell-checker to ignore words with a 'title' case, i.e. 

starting with an uppercase letter. They are spell-checked by default. 

Definition at line 1232 of file kspell.cpp.\index{KSpell@{KSpell}!misspelling@{misspelling}}
\index{misspelling@{misspelling}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::misspelling (const {\bf QString} \& {\em originalword}, const {\bf QString\-List} \& {\em suggestions}, unsigned int {\em pos})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l0}


Emitted whenever a misspelled word is found by {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() or by {\bf check\-Word}{\rm (p.\,\pageref{classKSpell_a7})}(). 

If it is emitted by {\bf check\-Word}{\rm (p.\,\pageref{classKSpell_a7})}(), {\tt pos=0}. If it is emitted by {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}(), then {\tt pos} indicates the position of the misspelled word in the (original) {\tt \_\-buffer}. (The first position is zero.) If it is emitted by {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}(), {\tt pos} is the index to the misspelled word in the {\bf QString\-List} passed to {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}(). Note, that {\tt originalword} can be only a word part, if it's word with hyphens.

These are called \_\-before\_\- the dialog is opened, so that the calling program's GUI may be updated. (e.g. the misspelled word may be highlighted). \index{KSpell@{KSpell}!corrected@{corrected}}
\index{corrected@{corrected}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::corrected (const {\bf QString} \& {\em originalword}, const {\bf QString} \& {\em newword}, unsigned int {\em pos})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l1}


Emitted after the \char`\"{}Replace\char`\"{} or \char`\"{}Replace All\char`\"{} buttons of the dialog was pressed, or if the word was corrected without calling the dialog (i.e., the user previously chose \char`\"{}Replace All\char`\"{} for this word). 

Results from the dialog may be checked with {\bf dlg\-Result}{\rm (p.\,\pageref{classKSpell_a10})}() and replacement().

Note, that when using {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}() this signal can occur more then once with same list position, when checking a word with hyphens. In this case {\tt originalword} is the last replacement.

\begin{Desc}
\item[See also:]{\bf check()}{\rm (p.\,\pageref{classKSpell_a4})} \end{Desc}
\index{KSpell@{KSpell}!ignoreall@{ignoreall}}
\index{ignoreall@{ignoreall}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::ignoreall (const {\bf QString} \& {\em originalword})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l2}


Emitted when the user pressed \char`\"{}Ignore All\char`\"{} in the dialog. 

This could be used to make an application or file specific user dictionary. \index{KSpell@{KSpell}!ignoreword@{ignoreword}}
\index{ignoreword@{ignoreword}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::ignoreword (const {\bf QString} \& {\em originalword})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l3}


Emitted when the user pressed \char`\"{}Ignore\char`\"{} in the dialog. 

Don't know if this could be useful. \index{KSpell@{KSpell}!addword@{addword}}
\index{addword@{addword}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::addword (const {\bf QString} \& {\em originalword})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l4}


Emitted when the user pressed \char`\"{}Add\char`\"{} in the dialog. 

This could be used to make an external user dictionary independent of the ISpell personal dictionary. \index{KSpell@{KSpell}!replaceall@{replaceall}}
\index{replaceall@{replaceall}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::replaceall (const {\bf QString} \& {\em origword}, const {\bf QString} \& {\em replacement})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l5}


Emitted when the user pressed \char`\"{}Replace\-All\char`\"{} in the dialog. 

\index{KSpell@{KSpell}!ready@{ready}}
\index{ready@{ready}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::ready ({\bf KSpell} $\ast$)\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l6}


Emitted after KSpell has verified that ISpell/ASpell is running and working properly. 



Referenced by KSpell().\index{KSpell@{KSpell}!progress@{progress}}
\index{progress@{progress}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::progress (unsigned int {\em i})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l7}


Emitted during a {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}(). 

{\tt i} is between 1 and 100. \index{KSpell@{KSpell}!done@{done}}
\index{done@{done}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::done (const {\bf QString} \& {\em buffer})\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l8}


Emitted when {\bf check}{\rm (p.\,\pageref{classKSpell_a4})}() is done. 

Be sure to copy the results of {\tt buffer} if you need them. You can only rely on the contents of buffer for the life of the slot which was signaled by {\bf done}{\rm (p.\,\pageref{classKSpell_l8})}(). 

Referenced by check().\index{KSpell@{KSpell}!done@{done}}
\index{done@{done}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::done (bool)\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l9}


Emitted when {\bf check\-List}{\rm (p.\,\pageref{classKSpell_a6})}() is done. 

If the argument is {\tt true}, then you should update your text from the wordlist, otherwise not. \index{KSpell@{KSpell}!death@{death}}
\index{death@{death}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KSpell::death ()\hspace{0.3cm}{\tt  [signal]}}\label{classKSpell_l10}


Emitted on terminal errors and after clean up. 

You can delete the KSpell object in this signal.

You can check {\bf status}{\rm (p.\,\pageref{classKSpell_a1})}() to see what caused the death: \begin{itemize}
\item {\tt Error} - KSpell could not start. \item {\tt Crashed} - KSpell encountered an unexpected error during execution. \item {\tt Finished} - Clean up finished. \end{itemize}


\subsection{Member Data Documentation}
\index{KSpell@{KSpell}!modaldlg@{modaldlg}}
\index{modaldlg@{modaldlg}!KSpell@{KSpell}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool {\bf KSpell::modaldlg}\hspace{0.3cm}{\tt  [protected]}}\label{classKSpell_p38}


Used for {\bf modal\-Check}{\rm (p.\,\pageref{classKSpell_e0})}. 



Definition at line 497 of file kspell.h.

Referenced by KSpell().

The documentation for this class was generated from the following files:\begin{CompactItemize}
\item 
kspell.h\item 
kspell.cpp\end{CompactItemize}
