class KEdit


Definition#include <keditcl.h>
InheritsQMultiLineEdit
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Types

Public Methods

Public Slots

Signals

Protected Methods

Protected Members


Detailed Description

 KEdit (KApplication *a=NULL,QWidget *parent=NULL, const char *name=NULL, const char *filename=NULL)

KEdit ()

enum {NONE, FORWARD, BACKWARD }

enum {KEDIT_OK = 0, KEDIT_OS_ERROR = 1, KEDIT_USER_CANCEL = 2 , KEDIT_RETRY = 3, KEDIT_NOPERMISSIONS = 4}

enum {OPEN_READWRITE = 1, OPEN_READONLY = 2, OPEN_INSERT = 4 }

int  newFile ()

Opens a new untitled document in the text widget The user is given a chance to save the current document if the current document has been modified.

int  doSave ()

Saves the file if necessary under the current file name. If the current file name is Untitled, as it is after a call to newFile(), this routing will call saveAs().

int  doSave ( const char *filename )

Saves the file as filename

int  saveAs ()

Allows the user to save the file under a new name

int  openFile ( int mode )

This will present an open file dialog and open the file specified by the user, if possible. The return codes are KEDIT_OK, KEDIT_USER_CANCEL and KEDIT_OS_ERROR. The user will be given a chance to save the current file if it has been modified. mode is one of OPEN_READONLY, OPEN_READWRITE. OPEN_READONLY means that the user will not be able to insert characters into the document.

int  insertFile ()

Calling this method will let the user insert a file at the current cursor position. Return codes are KEDIT_OK, KEDIT_USER_CANCEL, KDEDIT_OS_ERROR.

int  loadFile ( QString filename , int mode )

Loads the file filename into editor. The possible modes are OPEN_READONLY, OPEN_READWRITE, OPEN_INSERT. OPEN_READONLY means that the user will not be able to insert characters into the document. OPEN_INSERT means that the file will be inserted into the current document at the current cursor position.

QString  getName ()

Returns the filename of the currnet file. You can use setName() to set the filename of the current file

void  setName ( const char *_name )

Sets the filename of the currnet file. You can use getName() to set the filename of the current file

QString  markedText ()

Returns the currently marked text.

void  selectFont ()

Lets the user select a font and sets the font of the textwidget to that selected font.

void  Search ()

Presents a search dialog to the user

int  repeatSearch ()

Repeasts 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.

void  Replace ()

Presents a Search and Replace Dialog to the User.

void  doGotoLine ()

Presents a "Goto Line" dialog to the User

bool  isModified ()

Returns true if the document has been modified.

void  toggleModified ( bool )

Toggles the modification status of the document. TRUE = Modified, FALSE = UNMODIFIED. Methods such as doSave() rely on this to see whether the document needs to be saved.

void  setAutoIndentMode ( bool )

Sets the Indent Mode. TRUE = Indent mode on, FALSE = Indent mode off.

bool  AutoIndentMode ()

Returns the Indent Mode. TRUE = Indent mode on, FALSE = Indent mode off.

void  installRBPopup ( QPopupMenu* )

Install a Popup Menue for KEdit. The Popup Menu will be activated on a right mouse button press event.

int  currentLine ()

Returns the current line number, that is the line the cursor is on.

int  currentColumn ()

This returns 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.

bool  WordWrap ()

Returns TRUE if word wrap is on. You also need to specify the fill column with setFillColumnMode() otherwise wordwrap is not in effect.

void  setWordWrap (bool )

You also need to specify the fill column with setFillColumnMode() otherwise wordwrap is not in effect.

bool  FillColumnMode ()

Returns TRUE if fill column mode is on, that is if the line will be broken automatically when if a character is to be inserted past this position.

void  setFillColumnMode (int line, bool set)

Set the fill column to column col, if col is strictly larger than 0. If col is 0, fill column mode is turned off. In fill column mode, the line will be broken automatically at column col, when a character is inserted past column col..

void  saveBackupCopy (bool copy)

If copy is TRUE KEdit will make a backup copy of the document that is being edited on opening it. The backup copy will receive the suffix ~. The default is TRUE.

void  setFileName (char* name)

Sets the name of the file if a file is open.

void  saveasfile (char* name)

saves the current file as 'name'

void  setReduceWhiteOnJustify (bool reduce)

remove tabs and whitespace on the end of lines during a justify operation

bool  format (QStrList& )

bool  format2 (QStrList& par, int& upperbound)

void  getpar (int line,QStrList& par)

void  getpar2 (int line,QStrList& par,int& upperbound,QString &prefix)

void  fileChanged ()

[signal]

This signal is emitted when the document in the textwidget has changed

void  CursorPositionChanged ()

[signal]

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

void  saving ()

[signal]

This signal is emitted just before saving a file. Since KEdit calls kapp->processEvents(), you have a chance to let the user know what's going to happen.

void  loading ()

[signal]

This signal is emitted just before loading a file. Since KEdit calls kapp->processEvents(), you have a chance to let the user know what's going to happen.

void  toggle_overwrite_signal ()

[signal]

This signal is emitted if the user toggles from overwrite to insert mode. He can do so by pressing the "Insert" Button on a PC keyboard.

void  setModified ()

[slot]

void  search_slot ()

[slot]

void  searchdone_slot ()

[slot]

void  replace_slot ()

[slot]

void  replace_all_slot ()

[slot]

void  replace_search_slot ()

[slot]

void  replacedone_slot ()

[slot]

void  computePosition ()

[slot]

void  repaintAll ()

[slot]

QTimer* repaintTimer

[protected]

int  saveFile ()

[protected]

int  doSearch (QString s_pattern, bool case_sensitive, bool regex, bool forward,int line, int col)

[protected]

int  doReplace (QString s_pattern, bool case_sensitive, bool regex, bool forward,int line, int col,bool replace)

[protected]

QFileDialog*  getFileDialog (const char* captiontext)

[protected]

bool  eventFilter ( QObject *, QEvent * )

[protected]

void  keyPressEvent ( QKeyEvent * )

[protected]

void  mousePressEvent ( QMouseEvent* )

[protected]

void  mouseReleaseEvent ( QMouseEvent* )

[protected]

void  mouseMoveEvent ( QMouseEvent* )

[protected]


Generated by: root@george.devel.redhat.com on Thu Sep 14 21:18:43 2000, using kdoc 2.0a36.