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


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

Inheritance diagram for KEdit:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=58pt]{classKEdit__inherit__graph}
\end{center}
\end{figure}
Collaboration diagram for KEdit:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=188pt]{classKEdit__coll__graph}
\end{center}
\end{figure}
\subsection*{Public Types}
\begin{CompactItemize}
\item 
enum \{ {\bf NONE}, 
{\bf FORWARD}, 
{\bf BACKWARD}
 \}
\end{CompactItemize}
\subsection*{Public Slots}
\begin{CompactItemize}
\item 
void {\bf corrected} (const {\bf QString} \&originalword, const {\bf QString} \&newword, unsigned int pos)\label{classKEdit_i0}

\item 
void {\bf misspelling} (const {\bf QString} \&word, const {\bf QString\-List} \&, unsigned int pos)\label{classKEdit_i1}

\end{CompactItemize}
\subsection*{Signals}
\begin{CompactItemize}
\item 
void {\bf got\-Url\-Drop} ({\bf QDrop\-Event} $\ast$e)
\item 
void {\bf Cursor\-Position\-Changed} ()
\item 
void {\bf toggle\_\-overwrite\_\-signal} ()
\end{CompactItemize}
\subsection*{Public Member Functions}
\begin{CompactItemize}
\item 
{\bf KEdit} ({\bf QWidget} $\ast$\_\-parent=NULL, const char $\ast$name=NULL)
\item 
void {\bf insert\-Text} ({\bf QText\-Stream} $\ast$)
\item 
void {\bf save\-Text} ({\bf QText\-Stream} $\ast$, bool soft\-Wrap)
\item 
void {\bf save\-Text} ({\bf QText\-Stream} $\ast$)\label{classKEdit_a4}

\item 
void {\bf select\-Font} ()
\item 
void {\bf search} ()
\item 
bool {\bf repeat\-Search} ()
\item 
void {\bf replace} ()
\item 
void {\bf do\-Goto\-Line} ()
\item 
void {\bf clean\-White\-Space} ()
\item 
void {\bf install\-RBPopup} ({\bf QPopup\-Menu} $\ast$)
\item 
int {\bf current\-Line} ()
\item 
int {\bf current\-Column} ()
\item 
void {\bf spellcheck\_\-start} ()
\item 
void {\bf spellcheck\_\-stop} ()
\item 
void {\bf set\-Overwrite\-Enabled} (bool b)
\item 
{\bf QString} {\bf select\-Word\-Under\-Cursor} ()\label{classKEdit_a17}

\item 
{\bf QPopup\-Menu} $\ast$ {\bf create\-Popup\-Menu} (const {\bf QPoint} \&pos)
\item 
void {\bf set\-Auto\-Update} (bool b)\label{classKEdit_a19}

\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)
\item 
virtual void {\bf create} (WId=0, bool initialize\-Window=true, bool destroy\-Old\-Window=true)
\item 
virtual void {\bf ensure\-Cursor\-Visible} ()
\item 
virtual void {\bf set\-Cursor} (const {\bf QCursor} \&)\label{classKEdit_b6}

\item 
virtual void {\bf viewport\-Paint\-Event} ({\bf QPaint\-Event} $\ast$)\label{classKEdit_b7}

\item 
void {\bf key\-Press\-Event} ({\bf QKey\-Event} $\ast$)\label{classKEdit_b8}

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

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

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

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

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

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

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

\end{CompactItemize}


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

\begin{Desc}
\item[{\bf Deprecated}]Use KText\-Editor::Editor or {\bf KText\-Edit}{\rm (p.\,\pageref{classKTextEdit})} instead. \end{Desc}
\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} = {\tt NULL}, const char $\ast$ {\em name} = {\tt NULL})}\label{classKEdit_a0}


The usual constructor. 



Definition at line 49 of file keditcl1.cpp.

References 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 87 of file keditcl1.cpp.

References QMulti\-Line\-Edit::insert\-At(), QString::is\-Null(), QMulti\-Line\-Edit::set\-Cursor\-Position(), and QIODevice::size().\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 242 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 557 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 51 of file keditcl2.cpp.

References 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 225 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 247 of file keditcl2.cpp.

References 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 565 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 148 of file keditcl1.cpp.

References QString::from\-Latin1(), QMulti\-Line\-Edit::has\-Marked\-Text(), QString::is\-Empty(), QChar::is\-Space(), QString::length(), QMulti\-Line\-Edit::marked\-Text(), QMulti\-Line\-Edit::num\-Lines(), QMulti\-Line\-Edit::QMulti\-Line\-Edit(), QString::right(), QString::simplify\-White\-Space(), 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 553 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 290 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 297 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 1010 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 1068 of file keditcl2.cpp.\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 660 of file keditcl1.cpp.\index{KEdit@{KEdit}!createPopupMenu@{createPopupMenu}}
\index{createPopupMenu@{createPopupMenu}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}{\bf QPopup\-Menu} $\ast$ KEdit::create\-Popup\-Menu (const {\bf QPoint} \& {\em pos})}\label{classKEdit_a18}


\begin{Desc}
\item[Since:]3.3 \end{Desc}




Definition at line 1108 of file keditcl2.cpp.

References QPopup\-Menu::change\-Item(), QPopup\-Menu::id\-At(), and QPopup\-Menu::text().\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 set\-Overwrite\-Enabled(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 1058 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 = {\tt 0}, bool {\em initialize\-Window} = {\tt true}, bool {\em destroy\-Old\-Window} = {\tt true})\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKEdit_b4}


Reimplemented for internal reasons, the API is not affected. 



Definition at line 666 of file keditcl1.cpp.

References KCursor::set\-Auto\-Hide\-Cursor().\index{KEdit@{KEdit}!ensureCursorVisible@{ensureCursorVisible}}
\index{ensureCursorVisible@{ensureCursorVisible}!KEdit@{KEdit}}
\subsubsection{\setlength{\rightskip}{0pt plus 5cm}void KEdit::ensure\-Cursor\-Visible ()\hspace{0.3cm}{\tt  [protected, virtual]}}\label{classKEdit_b5}


Reimplemented for internal reasons, the API is not affected. 



Definition at line 672 of file keditcl1.cpp.

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