| # kdeui Library API Documentation
Overview | Class Hierarchy | Classes | Classes (annotated) | Members | Namespaces | Source Files

# KEdit Class Reference

A simple text editor for the KDE project. More...

`#include <keditcl.h>`

Inheritance diagram for KEdit:

[legend]
Collaboration diagram for KEdit:

[legend]
List of all members.

## Public Types
enum | { NONE, FORWARD, BACKWARD }
## Public Slots
void | corrected (const QString &originalword, const QString &newword, unsigned int pos)
void | misspelling (const QString &word, const QStringList &, unsigned int pos)
## Signals
void | gotUrlDrop (QDropEvent *e)
void | CursorPositionChanged ()
void | toggle_overwrite_signal ()
## Public Member Functions
| KEdit (QWidget *_parent=NULL, const char *name=NULL)
void | insertText (QTextStream *)
void | saveText (QTextStream *, bool softWrap)
void | saveText (QTextStream *)
void | selectFont ()
void | search ()
bool | repeatSearch ()
void | replace ()
void | doGotoLine ()
void | cleanWhiteSpace ()
void | installRBPopup (QPopupMenu *)
int | currentLine ()
int | currentColumn ()
void | spellcheck_start ()
void | spellcheck_stop ()
void | setOverwriteEnabled (bool b)
QString | selectWordUnderCursor ()
QPopupMenu * | createPopupMenu (const QPoint &pos)
void | setAutoUpdate (bool b)
## Protected Member Functions
void | computePosition ()
int | doSearch (QString s_pattern, bool case_sensitive, bool regex, bool forward, int line, int col)
int | doReplace (QString s_pattern, bool case_sensitive, bool regex, bool forward, int line, int col, bool replace)
void | posToRowCol (unsigned int pos, unsigned int &line, unsigned int &col)
virtual void | create (WId=0, bool initializeWindow=true, bool destroyOldWindow=true)
virtual void | ensureCursorVisible ()
virtual void | setCursor (const QCursor &)
virtual void | viewportPaintEvent (QPaintEvent *)
void | keyPressEvent (QKeyEvent *)
void | dragMoveEvent (QDragMoveEvent *e)
void | dragEnterEvent (QDragEnterEvent *e)
void | dropEvent (QDropEvent *e)
void | contentsDragMoveEvent (QDragMoveEvent *e)
void | contentsDragEnterEvent (QDragEnterEvent *e)
void | contentsDropEvent (QDropEvent *e)
virtual void | virtual_hook (int id, void *data)

## Detailed Description

A simple text editor for the KDE project.

Deprecated:
  Use KTextEditor::Editor or KTextEdit instead.

Author:
  Bernd Johannes Wuebben <wuebben@math.cornell.edu>, Waldo Bastian <bastian@kde.org>

Definition at line 171 of file keditcl.h.

## Member Enumeration Documentation

anonymous enum

| Search directions. Definition at line 187 of file keditcl.h.

## Constructor & Destructor Documentation

KEdit::KEdit | ( | QWidget * | _parent = `NULL`,
|  | const char * | name = `NULL`
| ) |

| The usual constructor. Definition at line 49 of file keditcl1.cpp. References KCursor::setAutoHideCursor().

## Member Function Documentation

void KEdit::insertText | ( | QTextStream * |  | ) |

| Insert text from the text stream into the edit widget. Definition at line 87 of file keditcl1.cpp. References QMultiLineEdit::insertAt(), QString::isNull(), QMultiLineEdit::setCursorPosition(), and QIODevice::size().

void KEdit::saveText | ( | QTextStream * | ,
|  | bool | softWrap
| ) |

| Save text from the edit widget to a text stream. If `softWrap` is false soft line wrappings are replaced with line-feeds If `softWrap` is true soft line wrappings are ignored. Since: 3.1 Definition at line 242 of file keditcl1.cpp. References QString::mid(), QMultiLineEdit::numLines(), and QMultiLineEdit::textLine().

void KEdit::selectFont | ( |  | ) |

| 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 KFontDialog::getFont().

void KEdit::search | ( |  | ) |

| Present a search dialog to the user. Definition at line 51 of file keditcl2.cpp. References QString::isEmpty(). Referenced by repeatSearch().

bool KEdit::repeatSearch | ( |  | ) |

| 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. Returns: `true` if a search was done. `false` if no search was done. Definition at line 225 of file keditcl2.cpp. References QString::isEmpty(), and search().

void KEdit::replace | ( |  | ) |

| Present a Search and Replace Dialog to the user. Definition at line 247 of file keditcl2.cpp. References QString::isEmpty().

void KEdit::doGotoLine | ( |  | ) |

| Present a "Goto Line" dialog to the user. Definition at line 565 of file keditcl1.cpp. References QMultiLineEdit::setCursorPosition().

void KEdit::cleanWhiteSpace | ( |  | ) |

| Clean up redundant whitespace from selected text. Definition at line 148 of file keditcl1.cpp. References QString::fromLatin1(), QMultiLineEdit::hasMarkedText(), QString::isEmpty(), QChar::isSpace(), QString::length(), QMultiLineEdit::markedText(), QMultiLineEdit::numLines(), QMultiLineEdit::QMultiLineEdit(), QString::right(), QString::simplifyWhiteSpace(), QStringList::split(), and QMultiLineEdit::textLine().

void KEdit::installRBPopup | ( | QPopupMenu * |  | ) |

| 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 KContextMenuManager::insert().

int KEdit::currentLine | ( |  | ) |

| Retrieve the current line number. The current line is the line the cursor is on. Definition at line 290 of file keditcl1.cpp.

int KEdit::currentColumn | ( |  | ) |

| Retrieve the actual column number the cursor is on. This call differs from QMultiLineEdit::getCursorPosition() in that it returns the actual cursor position and not the character position. Use currentLine() and currentColumn() if you want to display the current line or column in the status bar for example. Definition at line 297 of file keditcl1.cpp.

void KEdit::spellcheck_start | ( |  | ) |

| Start spellchecking mode. Definition at line 1010 of file keditcl2.cpp.

void KEdit::spellcheck_stop | ( |  | ) |

| Exit spellchecking mode. Definition at line 1068 of file keditcl2.cpp.

void KEdit::setOverwriteEnabled | ( | bool | b | ) |

| Allow the user to toggle between insert mode and overwrite mode with the "Insert" key. See also toggle_overwrite_signal(); The default is false: the user can not toggle. Definition at line 660 of file keditcl1.cpp.

QPopupMenu * KEdit::createPopupMenu | ( | const QPoint & | pos | ) |

| Since: 3.3 Definition at line 1108 of file keditcl2.cpp. References QPopupMenu::changeItem(), QPopupMenu::idAt(), and QPopupMenu::text().

void KEdit::gotUrlDrop | ( | QDropEvent * | e | ) | `[signal]`

| This signal is emitted if the user dropped a URL over the text editor QMultiLineEdit widget. Note that the user can drop also Text on it, but this is already handled internally by QMultiLineEdit.

void KEdit::CursorPositionChanged | ( |  | ) | `[signal]`

| This signal is emitted whenever the cursor position changes. Use this in conjunction with currentLine(), currentColumn() if you need to know the cursor position.

void KEdit::toggle_overwrite_signal | ( |  | ) | `[signal]`

| 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. This feature must be activated by calling setOverwriteEnabled(true) first.

void KEdit::posToRowCol | ( | unsigned int | pos,
|  | unsigned int & | line,
|  | unsigned int & | col
| ) | `[protected]`

| Sets line and col to the position pos, considering word wrap. Definition at line 1058 of file keditcl2.cpp. References QMultiLineEdit::lineLength(), and QMultiLineEdit::numLines().

void KEdit::create | ( | WId | = `0`,
|  | bool | initializeWindow = `true`,
|  | bool | destroyOldWindow = `true`
| ) | `[protected, virtual]`

| Reimplemented for internal reasons, the API is not affected. Definition at line 666 of file keditcl1.cpp. References KCursor::setAutoHideCursor().

void KEdit::ensureCursorVisible | ( |  | ) | `[protected, virtual]`

| 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:

- keditcl.h
- keditcl1.cpp
- keditcl2.cpp

This file is part of the documentation for kdeui Library Version 3.4.1.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 11 20:21:11 2005 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003