KSyntaxMultiLineEdit Class Reference

[Action.h Index] [Action.h Hierarchy]


KSyntaxMultiLineEdit is a widget that is able to show a text file with colored sections More...

#include <KColorMLE.h>

Inherits: QMultiLineEdit

Public Members

Public Slots

Protected Members

Protected Slots

Signals


Detailed Description

KSyntaxMultiLineEdit is a widget that is able to show a text file with colored sections. It has the following features: simple to use as a replacement for the QMultiLineEdit configurable syntax highlighting multiple undo and redo function

Be aware that the only functions that produce entries in the undo list are (besides the internal input functions) the UFXXX() methods; use these in order to perform an undoable action (e.g. use UFPaste() instead of paste()!


KSyntaxMultiLineEdit(const QString& mode, QWidget *parent=0, const char *name=0)

This creates a new KSyntaxMultiLineEdit.

Parameters:
name is passed on to the constructor of QMultiLineEdit and specifies thename of the newly created widget.
parent is passed on to the constructor of QMultiLineEdit and specifies the parent widget of the newly created one.
mode: mode is a string that contains the name of the mode (rule) file to be loaded and used to do the syntax coloring. this name includes the path and extension of the rule file.

virtual ~KSyntaxMultiLineEdit()

Destructor for KSyntaxMultiLineEdit.

int numVisibleLines()

Returns the number of lines visible (even partially) in the actual window.

void setMark(int startx, int starty, int endx, int endy)

Sets a new region of marked text.

Parameters:
endy is the ending row of the new marked region
startx is the starting col of the new marked region
endx is the ending col of the new marked region
starty is the starting row of the new marked region

EditorSettings& settings()

Returns a reference to the current settings of the editor widget. For more information on the settings see section EditorSettings

void setSettings(const EditorSettings& es)

Changes the settings of the KSyntaxMultiLineEdit to es. Does not call updateFromSettings() to make changes visible. For more information on the settings see section EditorSettings

Parameters:
es settings to apply to the editor widget.

void setNewMode(const QString& mode)

Sets the syntax coloring mode to mode. updateFromSettings() is called to show current text using the new mode.

Parameters:
mode mode file string; same format as mode parameter for constructor.

void updateFromSettings()

Must be called in order to make any changes in the settings of the editor widget become visible. Also needs to be called after changing the current syntax coloring mode.

inline bool dirty()

Returns the current state of the editor's dirty flag:

inline void setDirty(bool d = true)

sets or clears the dirty flag; also emits the dirtyChanged() signal to make it possible for external objects to update any visual representation of this flag.

virtual void newLine(bool doAutoIndent = true)

This function creates a new line of text; when the actual cursor position is at the end of a line, a new line is inserted after the current line; when the cursor is in the middle of a line of text, this line is splitted and the part to the right of the cursor is moved to the new line. The flag doAutoIndent indicates, wether auto indentation shoud be performed (when activated via EditorSettings or not.

virtual void killLine()

Deletes the contents of the actual line from the actual cursor position to the end of the line.

virtual void insertChar(char c)

Inserts character c into the text at the current cursor position and moves the cursor one character to the right.

virtual void backspace()

Deletes the char left to the cursor and moves cursor on char to the left.

virtual void del()

Deletes the char rightmost to the cursor; the cursor position remains unchanged.

void textChangedSlot()

Connected to the textChanged() signal to set the dirty flag according to any changes made in the text


Documentation generated by root@QBERT1 on Fri Jul 17 18:57:31 MEST 1998
Kdoc