# class toHighlightedText

A simple editor which supports syntax highlighting. More...

Definition | `#include <tohighlightedtext.h>`
Inherits | toMarkedText [public ]
Inherited by | toResultField
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- toHighlightedText (QWidget *parent,const char *name=NULL)
- virtual ~toHighlightedText ()
- void clear (void)
- void setText (const QString &str)
- void setErrors (const std::map<int,QString> &errors)
- void setCurrent (int current)
- int current (void)
- void setKeywordUpper (bool val)
- void setHighlight (bool val)
- void setAnalyzer (toSyntaxAnalyzer &analyzer)
- toSyntaxAnalyzer & analyzer (void)
- virtual void paintCell (QPainter *painter,int row,int col)
- virtual void paintEvent (QPaintEvent *pe)
- void tableAtCursor (QString &owner,QString &table,bool highlight=false)

#### Public Slots

- void nextError (void)
- void previousError (void)

#### Signals

- void insertedLines (int start,int diff)

#### Public Static Methods

- static int convertLine (int line,int start,int diff)

#### Protected Methods

- void setLeftIgnore (int ignore)
- virtual void keyPressEvent (QKeyEvent *e)
- virtual void focusOutEvent (QFocusEvent *e)
- virtual void checkComplete (void)
- virtual void startComplete (std::list<QString> &completes)

#### Protected Slots

- void textChanged (void)

## Detailed Description

A simple editor which supports syntax highlighting.

void setLeftIgnore (int ignore)

### setLeftIgnore

[protected]

Set how much of the left margin to ignore painting.

void keyPressEvent (QKeyEvent *e)

### keyPressEvent

[protected virtual]

Reimplemented for internal reasons.

Reimplemented from toMarkedText.

void focusOutEvent (QFocusEvent *e)

### focusOutEvent

[protected virtual]

Reimplemented for internal reasons.

Reimplemented from QMultiLineEdit.

void checkComplete (void)

### checkComplete

[protected virtual]

Check if to view completion.

void startComplete (std::list<QString> &completes)

### startComplete

[protected virtual]

Start a completion with a given completelist.

Parameters:

completes | List of available completions.

int convertLine (int line,int start,int diff)

### convertLine

[static]

Convert a linenumber after a change of the buffer to another linenumber. Can be used to convert a specific linenumber after receiving a insertedLines call.

Parameters:

line | Line number.
start | Start of change.
diff | Lines added or removed.

Returns: New linenumber or -1 if line doesn't exist anymore.

toHighlightedText (QWidget *parent,const char *name=NULL)

### toHighlightedText

Create a new editor.

Parameters:

parent | Parent of widget.
name | Name of widget.

~toHighlightedText ()

### ~toHighlightedText

[virtual]

Reimplemented for internal reasons

void clear (void)

### clear

Clear the editor.

Reimplemented from toMarkedText.

void setText (const QString &str)

### setText

Set the text of this editor.

Reimplemented from QMultiLineEdit.

void setErrors (const std::map<int,QString> &errors)

### setErrors

Set the error list map.

Parameters:

errors | A map of linenumbers to errorstrings. These will be displayed in the statusbar if the cursor is placed on the line.

void setCurrent (int current)

### setCurrent

Set current line. Will be indicated with a different background.

Parameters:

current | Current line.

int current (void)

### current

Get current line.

Returns: Current line.

void setKeywordUpper (bool val)

### setKeywordUpper

Set keyword upper flag. If this is set keywords will be converted to uppercase when painted.

Parameters:

val | New value of keyword to upper flag.

void setHighlight (bool val)

### setHighlight

The the highlighting flag. If this isn't set no highlighting is done.

void setAnalyzer (toSyntaxAnalyzer &analyzer)

### setAnalyzer

Set the syntax highlighter to use.

Parameters:

analyzer | Analyzer to use.

toSyntaxAnalyzer & analyzer (void)

### analyzer

Get the current syntaxhighlighter.

Returns: Analyzer used.

void paintCell (QPainter *painter,int row,int col)

### paintCell

[virtual]

Reimplemented for internal reasons.

Reimplemented from QMultiLineEdit.

void paintEvent (QPaintEvent *pe)

### paintEvent

[virtual]

Reimplemented for internal reasons.

Reimplemented from toMarkedText.

void tableAtCursor (QString &owner,QString &table,bool highlight=false)

### tableAtCursor

Get the tablename currently under the cursor.

Parameters:

owner | Filled with owner or table or QString::null if no owner specified.
table | Filled with tablename.
highlight | If true mark the extracted tablename

void insertedLines (int start,int diff)

### insertedLines

[signal]

Emitted when lines are inserted or removed.

Parameters:

start | Start of line inserted.
diff | Number of lines inserted or removed.

void textChanged (void)

### textChanged

[protected slots slot]

Reimplemented from QMultiLineEdit.

void nextError (void)

### nextError

[slot]

Go to next error.

void previousError (void)

### previousError

[slot]

Go to previous error.