.TH "KEdit" 3 "28 Jan 2004" "kdeui Library" \" -*- nroff -*-
.ad l
.nh
.SH NAME
KEdit \- A simple text editor for the \fBKDE\fP project.  

.PP
.SH SYNOPSIS
.br
.PP
\fC#include <keditcl.h>\fP
.PP
Inherits \fBQMultiLineEdit\fP.
.PP
.SS "Public Types"

.in +1c
.ti -1c
.RI "enum { \fBNONE\fP, \fBFORWARD\fP, \fBBACKWARD\fP }"
.br
.RI "\fISearch directions. \fP"
.in -1c
.SS "Signals"

.in +1c
.ti -1c
.RI "void \fBgotUrlDrop\fP (\fBQDropEvent\fP *e)"
.br
.RI "\fIThis signal is emitted if the user dropped a URL over the text editor \fBQMultiLineEdit\fP widget. \fP"
.ti -1c
.RI "void \fBCursorPositionChanged\fP ()"
.br
.RI "\fIThis signal is emitted whenever the cursor position changes. \fP"
.ti -1c
.RI "void \fBtoggle_overwrite_signal\fP ()"
.br
.RI "\fIThis signal is emitted if the user toggles from insert to overwrite mode or vice versa. \fP"
.in -1c
.SS "Public Member Functions"

.in +1c
.ti -1c
.RI "\fBKEdit\fP (\fBQWidget\fP *_parent=NULL, const  char *name=NULL)"
.br
.RI "\fIThe usual constructor. \fP"
.ti -1c
.RI "void \fBinsertText\fP (\fBQTextStream\fP *)"
.br
.RI "\fIInsert text from the text stream into the edit widget. \fP"
.ti -1c
.RI "void \fBsaveText\fP (\fBQTextStream\fP *, bool softWrap)"
.br
.RI "\fISave text from the edit widget to a text stream. \fP"
.ti -1c
.RI "void \fBsaveText\fP (\fBQTextStream\fP *)"
.br
.ti -1c
.RI "void \fBselectFont\fP ()"
.br
.RI "\fILet the user select a font and set the font of the textwidget to that selected font. \fP"
.ti -1c
.RI "void \fBsearch\fP ()"
.br
.RI "\fIPresent a search dialog to the user. \fP"
.ti -1c
.RI "bool \fBrepeatSearch\fP ()"
.br
.RI "\fIRepeat the last search specified on the search dialog. \fP"
.ti -1c
.RI "void \fBreplace\fP ()"
.br
.RI "\fIPresent a Search and Replace Dialog to the user. \fP"
.ti -1c
.RI "void \fBdoGotoLine\fP ()"
.br
.RI "\fIPresent a 'Goto Line' dialog to the user. \fP"
.ti -1c
.RI "void \fBcleanWhiteSpace\fP ()"
.br
.RI "\fIClean up redundant whitespace from selected text. \fP"
.ti -1c
.RI "void \fBinstallRBPopup\fP (\fBQPopupMenu\fP *)"
.br
.RI "\fIInstall a context menu for KEdit. \fP"
.ti -1c
.RI "int \fBcurrentLine\fP ()"
.br
.RI "\fIRetrieve the current line number. \fP"
.ti -1c
.RI "int \fBcurrentColumn\fP ()"
.br
.RI "\fIRetrieve the actual column number the cursor is on. \fP"
.ti -1c
.RI "void \fBspellcheck_start\fP ()"
.br
.RI "\fIStart spellchecking mode. \fP"
.ti -1c
.RI "void \fBspellcheck_stop\fP ()"
.br
.RI "\fIExit spellchecking mode. \fP"
.ti -1c
.RI "void \fBsetOverwriteEnabled\fP (bool b)"
.br
.RI "\fIAllow the user to toggle between insert mode and overwrite mode with the 'Insert' key. \fP"
.in -1c
.SS "Protected Member Functions"

.in +1c
.ti -1c
.RI "void \fBcomputePosition\fP ()"
.br
.ti -1c
.RI "int \fBdoSearch\fP (\fBQString\fP s_pattern, bool case_sensitive, bool regex, bool forward, int line, int col)"
.br
.ti -1c
.RI "int \fBdoReplace\fP (\fBQString\fP s_pattern, bool case_sensitive, bool regex, bool forward, int line, int col, bool replace)"
.br
.ti -1c
.RI "void \fBposToRowCol\fP (unsigned int pos, unsigned int &line, unsigned int &col)"
.br
.RI "\fISets line and col to the position pos, considering word wrap. \fP"
.ti -1c
.RI "virtual void \fBcreate\fP (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)"
.br
.RI "\fIReimplemented for internal reasons, the API is not affected. \fP"
.ti -1c
.RI "void \fBkeyPressEvent\fP (\fBQKeyEvent\fP *)"
.br
.ti -1c
.RI "void \fBdragMoveEvent\fP (\fBQDragMoveEvent\fP *e)"
.br
.ti -1c
.RI "void \fBdragEnterEvent\fP (\fBQDragEnterEvent\fP *e)"
.br
.ti -1c
.RI "void \fBdropEvent\fP (\fBQDropEvent\fP *e)"
.br
.ti -1c
.RI "void \fBcontentsDragMoveEvent\fP (\fBQDragMoveEvent\fP *e)"
.br
.ti -1c
.RI "void \fBcontentsDragEnterEvent\fP (\fBQDragEnterEvent\fP *e)"
.br
.ti -1c
.RI "void \fBcontentsDropEvent\fP (\fBQDropEvent\fP *e)"
.br
.ti -1c
.RI "virtual void \fBvirtual_hook\fP (int id, void *data)"
.br
.in -1c
.SH "Detailed Description"
.PP 
A simple text editor for the \fBKDE\fP project. 

\fBThis class or method is obsolete, it is provided for compatibility only.\fP. Use KTextEditor::Editor or \fBKTextEdit\fP instead.
.PP
\fBAuthor:\fP
.RS 4
Bernd Johannes Wuebben <wuebben@math.cornell.edu>, Waldo Bastian <bastian@kde.org> 
.RE
.PP

.PP
Definition at line 171 of file keditcl.h.
.SH "Member Enumeration Documentation"
.PP 
.SS "anonymous enum"
.PP
Search directions. Definition at line 187 of file keditcl.h.
.SH "Constructor & Destructor Documentation"
.PP 
.SS "KEdit::KEdit (\fBQWidget\fP * _parent = NULL, const char * name = NULL)"
.PP
The usual constructor. Definition at line 47 of file keditcl1.cpp.
.PP
References KStdAccel::name(), and KCursor::setAutoHideCursor().
.SH "Member Function Documentation"
.PP 
.SS "void KEdit::insertText (\fBQTextStream\fP *)"
.PP
Insert text from the text stream into the edit widget. Definition at line 78 of file keditcl1.cpp.
.PP
References QTextStream::device(), QMultiLineEdit::insertAt(), QString::isNull(), QTextStream::read(), QTextStream::readLine(), QMultiLineEdit::setCursorPosition(), QIODevice::size(), and QMultiLineEdit::textLine().
.SS "void KEdit::saveText (\fBQTextStream\fP *, bool softWrap)"
.PP
Save text from the edit widget to a text stream. If \fCsoftWrap\fP is false soft line wrappings are replaced with line-feeds If \fCsoftWrap\fP is true soft line wrappings are ignored. 
.PP
\fBSince:\fP
.RS 4
3.1 
.RE
.PP
Definition at line 233 of file keditcl1.cpp.
.PP
References QString::mid(), QMultiLineEdit::numLines(), and QMultiLineEdit::textLine().
.SS "void KEdit::selectFont ()"
.PP
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.
.PP
References KFontDialog::getFont().
.SS "void KEdit::search ()"
.PP
Present a search dialog to the user. Definition at line 50 of file keditcl2.cpp.
.PP
References KStdAction::deselect(), and QString::isEmpty().
.PP
Referenced by repeatSearch().
.SS "bool KEdit::repeatSearch ()"
.PP
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.
.PP
\fBReturns:\fP
.RS 4
\fCtrue\fP if a search was done. \fCfalse\fP if no search was done. 
.RE
.PP
Definition at line 223 of file keditcl2.cpp.
.PP
References QString::isEmpty(), and search().
.SS "void KEdit::replace ()"
.PP
Present a Search and Replace Dialog to the user. Definition at line 245 of file keditcl2.cpp.
.PP
References KStdAction::deselect(), KStdAccel::find(), and QString::isEmpty().
.SS "void KEdit::doGotoLine ()"
.PP
Present a 'Goto Line' dialog to the user. Definition at line 524 of file keditcl1.cpp.
.PP
References QMultiLineEdit::setCursorPosition().
.SS "void KEdit::cleanWhiteSpace ()"
.PP
Clean up redundant whitespace from selected text. Definition at line 139 of file keditcl1.cpp.
.PP
References KStdAction::deselect(), QString::fromLatin1(), QMultiLineEdit::hasMarkedText(), KStdAccel::insert(), QString::isEmpty(), QChar::isSpace(), QMultiLineEdit::markedText(), QMultiLineEdit::numLines(), QMultiLineEdit::QMultiLineEdit(), QString::right(), KStdAccel::selectAll(), QStringList::split(), and QMultiLineEdit::textLine().
.SS "void KEdit::installRBPopup (\fBQPopupMenu\fP *)"
.PP
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.
.PP
References KContextMenuManager::insert().
.SS "int KEdit::currentLine ()"
.PP
Retrieve the current line number. The current line is the line the cursor is on. Definition at line 281 of file keditcl1.cpp.
.SS "int KEdit::currentColumn ()"
.PP
Retrieve the actual column number the cursor is on. This call differs from \fBQMultiLineEdit::getCursorPosition\fP() in that it returns the actual cursor position and not the character position. Use \fBcurrentLine\fP() and \fBcurrentColumn\fP() if you want to display the current line or column in the status bar for example. Definition at line 288 of file keditcl1.cpp.
.SS "void KEdit::spellcheck_start ()"
.PP
Start spellchecking mode. Definition at line 999 of file keditcl2.cpp.
.SS "void KEdit::spellcheck_stop ()"
.PP
Exit spellchecking mode. Definition at line 1057 of file keditcl2.cpp.
.PP
References KStdAction::deselect().
.SS "void KEdit::setOverwriteEnabled (bool b)"
.PP
Allow the user to toggle between insert mode and overwrite mode with the 'Insert' key. See also \fBtoggle_overwrite_signal\fP();
.PP
The default is false: the user can not toggle. Definition at line 619 of file keditcl1.cpp.
.SS "void KEdit::gotUrlDrop (\fBQDropEvent\fP * e)\fC [signal]\fP"
.PP
This signal is emitted if the user dropped a URL over the text editor \fBQMultiLineEdit\fP widget. Note that the user can drop also Text on it, but this is already handled internally by \fBQMultiLineEdit\fP. 
.SS "void KEdit::CursorPositionChanged ()\fC [signal]\fP"
.PP
This signal is emitted whenever the cursor position changes. Use this in conjunction with \fBcurrentLine\fP(), \fBcurrentColumn\fP() if you need to know the cursor position. 
.SS "void KEdit::toggle_overwrite_signal ()\fC [signal]\fP"
.PP
This signal is emitted if the user toggles from insert to overwrite mode or vice versa. The user can do so by pressing the 'Insert' button on a PC keyboard.
.PP
This feature must be activated by calling \fBsetOverwriteEnabled\fP(true) first. 
.SS "void KEdit::posToRowCol (unsigned int pos, unsigned int & line, unsigned int & col)\fC [protected]\fP"
.PP
Sets line and col to the position pos, considering word wrap. Definition at line 1047 of file keditcl2.cpp.
.PP
References QMultiLineEdit::lineLength(), and QMultiLineEdit::numLines().
.SS "void KEdit::create (WId = 0, bool initializeWindow = true, bool destroyOldWindow = true)\fC [protected, virtual]\fP"
.PP
Reimplemented for internal reasons, the API is not affected. Definition at line 625 of file keditcl1.cpp.
.PP
References KCursor::setAutoHideCursor().

.SH "Author"
.PP 
Generated automatically by Doxygen for kdeui Library from the source code.
