\section{KEdit Class Reference}
\label{classKEdit}\index{KEdit@{KEdit}}
A simple text editor for the {\bf KDE} project.  


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

Inheritance diagram for KEdit:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=62pt]{classKEdit__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KEdit:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=220pt]{classKEdit__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum \{ {\bf NONE}, 
{\bf FORWARD}, 
{\bf BACKWARD}
 \}
\begin{CompactList}\small\item\em Search directions. \item\end{CompactList}\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf got\-Url\-Drop} ({\bf QDrop\-Event} $\ast$e)
\begin{CompactList}\small\item\em This signal is emitted if the user dropped a URL over the text editor {\bf QMulti\-Line\-Edit} widget. \item\end{CompactList}\item 
void {\bf Cursor\-Position\-Changed} ()
\begin{CompactList}\small\item\em This signal is emitted whenever the cursor position changes. \item\end{CompactList}\item 
void {\bf toggle\_\-overwrite\_\-signal} ()
\begin{CompactList}\small\item\em This signal is emitted if the user toggles from insert to overwrite mode or vice versa. \item\end{CompactList}\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KEdit} ({\bf QWidget} $\ast$\_\-parent=NULL, const  char $\ast$name=NULL)
\begin{CompactList}\small\item\em The usual constructor. \item\end{CompactList}\item 
void {\bf insert\-Text} ({\bf QText\-Stream} $\ast$)
\begin{CompactList}\small\item\em Insert text from the text stream into the edit widget. \item\end{CompactList}\item 
void {\bf save\-Text} ({\bf QText\-Stream} $\ast$, bool soft\-Wrap)
\begin{CompactList}\small\item\em Save text from the edit widget to a text stream. \item\end{CompactList}\item 
void {\bf save\-Text} ({\bf QText\-Stream} $\ast$)\label{classKEdit_a4}

\item 
void {\bf select\-Font} ()
\begin{CompactList}\small\item\em Let the user select a font and set the font of the textwidget to that selected font. \item\end{CompactList}\item 
void {\bf search} ()
\begin{CompactList}\small\item\em Present a search dialog to the user. \item\end{CompactList}\item 
bool {\bf repeat\-Search} ()
\begin{CompactList}\small\item\em Repeat the last search specified on the search dialog. \item\end{CompactList}\item 
void {\bf replace} ()
\begin{CompactList}\small\item\em Present a Search and Replace Dialog to the user. \item\end{CompactList}\item 
void {\bf do\-Goto\-Line} ()
\begin{CompactList}\small\item\em Present a \char`\"{}Goto Line\char`\"{} dialog to the user. \item\end{CompactList}\item 
void {\bf clean\-White\-Space} ()
\begin{CompactList}\small\item\em Clean up redundant whitespace from selected text. \item\end{CompactList}\item 
void {\bf install\-RBPopup} ({\bf QPopup\-Menu} $\ast$)
\begin{CompactList}\small\item\em Install a context menu for KEdit. \item\end{CompactList}\item 
int {\bf current\-Line} ()
\begin{CompactList}\small\item\em Retrieve the current line number. \item\end{CompactList}\item 
int {\bf current\-Column} ()
\begin{CompactList}\small\item\em Retrieve the actual column number the cursor is on. \item\end{CompactList}\item 
void {\bf spellcheck\_\-start} ()
\begin{CompactList}\small\item\em Start spellchecking mode. \item\end{CompactList}\item 
void {\bf spellcheck\_\-stop} ()
\begin{CompactList}\small\item\em Exit spellchecking mode. \item\end{CompactList}\item 
void {\bf set\-Overwrite\-Enabled} (bool b)
\begin{CompactList}\small\item\em Allow the user to toggle between insert mode and overwrite mode with the \char`\"{}Insert\char`\"{} key. \item\end{CompactList}\end{CompactItemize}
\subsection*{Protected Member Functions}
\begin{CompactItemize}
\item 
void {\bf compute\-Position} ()\label{classKEdit_b0}

\item 
int {\bf do\-Search} ({\bf QString} s\_\-pattern, bool case\_\-sensitive, bool regex, bool forward, int line, int col)\label{classKEdit_b1}

\item 
int {\bf do\-Replace} ({\bf QString} s\_\-pattern, bool case\_\-sensitive, bool regex, bool forward, int line, int col, bool replace)\label{classKEdit_b2}

\item 
void {\bf pos\-To\-Row\-Col} (unsigned int pos, unsigned int \&line, unsigned int \&col)
\begin{CompactList}\small\item\em Sets line and col to the position pos, considering word wrap. \item\end{CompactList}\item 
virtual void {\bf create} (WId=0, bool initialize\-Window=true, bool destroy\-Old\-Window=true)
\begin{CompactList}\small\item\em Reimplemented for internal reasons, the API is not affected. \item\end{CompactList}\item 
void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast$)\label{classKEdit_b5}

\item 
void {\bf drag\-Move\-Event} ({\bf QDrag\-Move\-Event} $\ast$e)\label{classKEdit_b6}

\item 
void {\bf drag\-Enter\-Event} ({\bf QDrag\-Enter\-Event} $\ast$e)\label{classKEdit_b7}

\item 
void {\bf drop\-Event} ({\bf QDrop\-Event} $\ast$e)\label{classKEdit_b8}

\item 
void {\bf contents\-Drag\-Move\-Event} ({\bf QDrag\-Move\-Event} $\ast$e)\label{classKEdit_b9}

\item 
void {\bf contents\-Drag\-Enter\-Event} ({\bf QDrag\-Enter\-Event} $\ast$e)\label{classKEdit_b10}

\item 
void {\bf contents\-Drop\-Event} ({\bf QDrop\-Event} $\ast$e)\label{classKEdit_b11}

\item 
virtual void {\bf virtual\_\-hook} (int id, void $\ast$data)\label{classKEdit_b12}

\end{CompactItemize}


\subsection{Detailed Description}
A simple text editor for the {\bf KDE} project. 

{\bf This class or method is obsolete, it is provided for compatibility only.}. Use KText\-Editor::Editor or {\bf KText\-Edit}{\rm (p.\,\pageref{classKTextEdit})} instead.

\begin{Desc}
\item[Author:]Bernd Johannes Wuebben $<${\tt wuebben@math.cornell.edu}$>$, Waldo Bastian $<${\tt bastian@kde.org}$>$ \end{Desc}




Definition at line 171 of file keditcl.h.

\subsection{Member Enumeration Documentation}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}anonymous enum}\label{classKEdit_w3}


Search directions. 



Definition at line 187 of file keditcl.h.

\subsection{Constructor \& Destructor Documentation}
\index{KEdit@{KEdit}!KEdit@{KEdit}}
\index{KEdit@{KEdit}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}KEdit::KEdit ({\bf QWidget} $\ast$ {\em \_\-parent} = NULL, const char $\ast$ {\em name} = NULL)}\label{classKEdit_a0}


The usual constructor. 



Definition at line 47 of file keditcl1.cpp.

References KStd\-Accel::name(), and KCursor::set\-Auto\-Hide\-Cursor().

\subsection{Member Function Documentation}
\index{KEdit@{KEdit}!insertText@{insertText}}
\index{insertText@{insertText}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::insert\-Text ({\bf QText\-Stream} $\ast$)}\label{classKEdit_a2}


Insert text from the text stream into the edit widget. 



Definition at line 78 of file keditcl1.cpp.

References QText\-Stream::device(), QMulti\-Line\-Edit::insert\-At(), QString::is\-Null(), QText\-Stream::read(), QText\-Stream::read\-Line(), QMulti\-Line\-Edit::set\-Cursor\-Position(), QIODevice::size(), and QMulti\-Line\-Edit::text\-Line().\index{KEdit@{KEdit}!saveText@{saveText}}
\index{saveText@{saveText}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::save\-Text ({\bf QText\-Stream} $\ast$, bool {\em soft\-Wrap})}\label{classKEdit_a3}


Save text from the edit widget to a text stream. 

If {\tt soft\-Wrap} is false soft line wrappings are replaced with line-feeds If {\tt soft\-Wrap} is true soft line wrappings are ignored. \begin{Desc}
\item[Since:]3.1 \end{Desc}


Definition at line 233 of file keditcl1.cpp.

References QString::mid(), QMulti\-Line\-Edit::num\-Lines(), and QMulti\-Line\-Edit::text\-Line().\index{KEdit@{KEdit}!selectFont@{selectFont}}
\index{selectFont@{selectFont}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::select\-Font ()}\label{classKEdit_a5}


Let the user select a font and set the font of the textwidget to that selected font. 



Definition at line 516 of file keditcl1.cpp.

References KFont\-Dialog::get\-Font().\index{KEdit@{KEdit}!search@{search}}
\index{search@{search}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::search ()}\label{classKEdit_a6}


Present a search dialog to the user. 



Definition at line 50 of file keditcl2.cpp.

References KStd\-Action::deselect(), and QString::is\-Empty().

Referenced by repeat\-Search().\index{KEdit@{KEdit}!repeatSearch@{repeatSearch}}
\index{repeatSearch@{repeatSearch}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}bool KEdit::repeat\-Search ()}\label{classKEdit_a7}


Repeat the last search specified on the search dialog. 

If the user hasn't searched for anything until now, this method will simply return without doing anything.

\begin{Desc}
\item[Returns:]{\tt true} if a search was done. {\tt false} if no search was done. \end{Desc}


Definition at line 223 of file keditcl2.cpp.

References QString::is\-Empty(), and search().\index{KEdit@{KEdit}!replace@{replace}}
\index{replace@{replace}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::replace ()}\label{classKEdit_a8}


Present a Search and Replace Dialog to the user. 



Definition at line 245 of file keditcl2.cpp.

References KStd\-Action::deselect(), KStd\-Accel::find(), and QString::is\-Empty().\index{KEdit@{KEdit}!doGotoLine@{doGotoLine}}
\index{doGotoLine@{doGotoLine}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::do\-Goto\-Line ()}\label{classKEdit_a9}


Present a \char`\"{}Goto Line\char`\"{} dialog to the user. 



Definition at line 524 of file keditcl1.cpp.

References QMulti\-Line\-Edit::set\-Cursor\-Position().\index{KEdit@{KEdit}!cleanWhiteSpace@{cleanWhiteSpace}}
\index{cleanWhiteSpace@{cleanWhiteSpace}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::clean\-White\-Space ()}\label{classKEdit_a10}


Clean up redundant whitespace from selected text. 



Definition at line 139 of file keditcl1.cpp.

References KStd\-Action::deselect(), QString::from\-Latin1(), QMulti\-Line\-Edit::has\-Marked\-Text(), KStd\-Accel::insert(), QString::is\-Empty(), QChar::is\-Space(), QMulti\-Line\-Edit::marked\-Text(), QMulti\-Line\-Edit::num\-Lines(), QMulti\-Line\-Edit::QMulti\-Line\-Edit(), QString::right(), KStd\-Accel::select\-All(), QString\-List::split(), and QMulti\-Line\-Edit::text\-Line().\index{KEdit@{KEdit}!installRBPopup@{installRBPopup}}
\index{installRBPopup@{installRBPopup}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::install\-RBPopup ({\bf QPopup\-Menu} $\ast$)}\label{classKEdit_a11}


Install a context menu for KEdit. 

The Popup Menu will be activated on a right mouse button press event. 

Definition at line 512 of file keditcl1.cpp.

References KContext\-Menu\-Manager::insert().\index{KEdit@{KEdit}!currentLine@{currentLine}}
\index{currentLine@{currentLine}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KEdit::current\-Line ()}\label{classKEdit_a12}


Retrieve the current line number. 

The current line is the line the cursor is on. 

Definition at line 281 of file keditcl1.cpp.\index{KEdit@{KEdit}!currentColumn@{currentColumn}}
\index{currentColumn@{currentColumn}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}int KEdit::current\-Column ()}\label{classKEdit_a13}


Retrieve the actual column number the cursor is on. 

This call differs from QMulti\-Line\-Edit::get\-Cursor\-Position() in that it returns the actual cursor position and not the character position. Use {\bf current\-Line}{\rm (p.\,\pageref{classKEdit_a12})}() and {\bf current\-Column}{\rm (p.\,\pageref{classKEdit_a13})}() if you want to display the current line or column in the status bar for example. 

Definition at line 288 of file keditcl1.cpp.\index{KEdit@{KEdit}!spellcheck_start@{spellcheck\_\-start}}
\index{spellcheck_start@{spellcheck\_\-start}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::spellcheck\_\-start ()}\label{classKEdit_a14}


Start spellchecking mode. 



Definition at line 999 of file keditcl2.cpp.\index{KEdit@{KEdit}!spellcheck_stop@{spellcheck\_\-stop}}
\index{spellcheck_stop@{spellcheck\_\-stop}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::spellcheck\_\-stop ()}\label{classKEdit_a15}


Exit spellchecking mode. 



Definition at line 1057 of file keditcl2.cpp.

References KStd\-Action::deselect().\index{KEdit@{KEdit}!setOverwriteEnabled@{setOverwriteEnabled}}
\index{setOverwriteEnabled@{setOverwriteEnabled}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::set\-Overwrite\-Enabled (bool {\em b})}\label{classKEdit_a16}


Allow the user to toggle between insert mode and overwrite mode with the \char`\"{}Insert\char`\"{} key. 

See also {\bf toggle\_\-overwrite\_\-signal}{\rm (p.\,\pageref{classKEdit_l2})}();

The default is false: the user can not toggle. 

Definition at line 619 of file keditcl1.cpp.\index{KEdit@{KEdit}!gotUrlDrop@{gotUrlDrop}}
\index{gotUrlDrop@{gotUrlDrop}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::got\-Url\-Drop ({\bf QDrop\-Event} $\ast$ {\em e})\hspace{0.3cm}{\tt  [signal]}}\label{classKEdit_l0}


This signal is emitted if the user dropped a URL over the text editor {\bf QMulti\-Line\-Edit} widget. 

Note that the user can drop also Text on it, but this is already handled internally by {\bf QMulti\-Line\-Edit}. \index{KEdit@{KEdit}!CursorPositionChanged@{CursorPositionChanged}}
\index{CursorPositionChanged@{CursorPositionChanged}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::Cursor\-Position\-Changed ()\hspace{0.3cm}{\tt  [signal]}}\label{classKEdit_l1}


This signal is emitted whenever the cursor position changes. 

Use this in conjunction with {\bf current\-Line}{\rm (p.\,\pageref{classKEdit_a12})}(), {\bf current\-Column}{\rm (p.\,\pageref{classKEdit_a13})}() if you need to know the cursor position. \index{KEdit@{KEdit}!toggle_overwrite_signal@{toggle\_\-overwrite\_\-signal}}
\index{toggle_overwrite_signal@{toggle\_\-overwrite\_\-signal}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::toggle\_\-overwrite\_\-signal ()\hspace{0.3cm}{\tt  [signal]}}\label{classKEdit_l2}


This signal is emitted if the user toggles from insert to overwrite mode or vice versa. 

The user can do so by pressing the \char`\"{}Insert\char`\"{} button on a PC keyboard.

This feature must be activated by calling {\bf set\-Overwrite\-Enabled}{\rm (p.\,\pageref{classKEdit_a16})}(true) first. \index{KEdit@{KEdit}!posToRowCol@{posToRowCol}}
\index{posToRowCol@{posToRowCol}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::pos\-To\-Row\-Col (unsigned int {\em pos}, unsigned int \& {\em line}, unsigned int \& {\em col})\hspace{0.3cm}{\tt  [protected]}}\label{classKEdit_b3}


Sets line and col to the position pos, considering word wrap. 



Definition at line 1047 of file keditcl2.cpp.

References QMulti\-Line\-Edit::line\-Length(), and QMulti\-Line\-Edit::num\-Lines().\index{KEdit@{KEdit}!create@{create}}
\index{create@{create}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::create (WId = 0, bool {\em initialize\-Window} = true, bool {\em destroy\-Old\-Window} = true)\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKEdit_b4}


Reimplemented for internal reasons, the API is not affected. 



Definition at line 625 of file keditcl1.cpp.

References KCursor::set\-Auto\-Hide\-Cursor().

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