TQScintilla: TQextScintillaLexer Class Reference

- Main Page
- Classes
- Related Pages

- Class List
- Class Hierarchy
- Class Members

# TQextScintillaLexer Class Reference

The TQextScintillaLexer class is an abstract class used as a base for specific language lexers. More...

`#include <tqextscintillalexer.h>`

Inherited by TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSS, TQextScintillaLexerDiff, TQextScintillaLexerHTML, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, TQextScintillaLexerSQL, and TQextScintillaLexerTeX.

List of all members.

## Public Slots

- virtual void setAutoIndentStyle (int autoindentstyle)
- virtual void setColor (const TQColor &c, int style=-1)
- virtual void setDefaultFont (const TQFont &f)
- virtual void setDefaultColor (const TQColor &c)
- virtual void setDefaultPaper (const TQColor &c)
- virtual void setEolFill (bool eoffill, int style=-1)
- virtual void setFont (const TQFont &f, int style=-1)
- virtual void setPaper (const TQColor &c, int style=-1)

## Signals

- void colorChanged (const TQColor &c, int style)
- void eolFillChanged (bool eoffilled, int style)
- void fontChanged (const TQFont &f, int style)
- void paperChanged (const TQColor &c, int style)
- void propertyChanged (const char *prop, const char *val)

## Public Member Functions

- TQextScintillaLexer (TQObject *parent=0, const char *name=0)
- virtual ~TQextScintillaLexer ()
- virtual const char * language () const =0
- virtual const char * lexer () const =0
- virtual const char * autoCompletionFillups () const
- virtual const char * autoCompletionStartCharacters () const
- int autoIndentStyle ()
- virtual const char * blockEnd (int *style=0) const
- virtual int blockLookback () const
- virtual const char * blockStart (int *style=0) const
- virtual const char * blockStartKeyword (int *style=0) const
- virtual int braceStyle () const
- virtual const char * wordCharacters () const
- virtual TQColor color (int style) const
- virtual bool eolFill (int style) const
- virtual TQFont font (int style) const
- virtual const char * keywords (int set) const
- virtual int defaultStyle () const
- virtual TQString description (int style) const =0
- virtual TQColor paper (int style) const
- virtual TQFont defaultFont () const
- virtual TQColor defaultColor () const
- virtual TQColor defaultPaper () const
- virtual void refreshProperties ()
- bool readSettings (TQSettings &qs, const char *prefix="/Scintilla")
- bool writeSettings (TQSettings &qs, const char *prefix="/Scintilla") const

## Protected Member Functions

- virtual bool readProperties (TQSettings &qs, const TQString &prefix)
- virtual bool writeProperties (TQSettings &qs, const TQString &prefix) const

## Detailed Description

The TQextScintillaLexer class is an abstract class used as a base for specific language lexers.

A Scintilla lexer scans the text breaking it up into separate language objects, e.g. keywords, strings, operators. The lexer then uses a different style to draw each object. A style is identified by a style number and has a number of attributes, including colour and font. A specific language lexer will implement appropriate default styles which can be overriden by an application by further sub-classing the specific language lexer.

A specific language lexer may provide one or more sets of words to be recognised as keywords. Most lexers only provide one set, but some may support languages embedded in other languages and provide several sets.

TQextScintillaLexer provides convenience methods for saving and restoring user preferences for fonts and colours.

## Constructor & Destructor Documentation

TQextScintillaLexer::TQextScintillaLexer | ( | TQObject * | parent = `0`,
|  | const char * | name = `0` |
| ) |  |  |

Construct a TQextScintillaLexer with parent parent and name name. parent is typically the TQextScintilla instance.

virtual TQextScintillaLexer::~TQextScintillaLexer | ( |  | ) | `[virtual]`

Destroys the TQextScintillaLexer instance.

## Member Function Documentation

virtual const char* TQextScintillaLexer::language | ( |  | ) | const`[pure virtual]`

Returns the name of the language. It must be re-implemented by a sub-class.

Implemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerCSS, TQextScintillaLexerDiff, TQextScintillaLexerHTML, TQextScintillaLexerIDL, TQextScintillaLexerJava, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, TQextScintillaLexerSQL, and TQextScintillaLexerTeX.

virtual const char* TQextScintillaLexer::lexer | ( |  | ) | const`[pure virtual]`

Returns the name of the lexer. Some lexers support a number of languages. It must be re-implemented by a sub-class.

Implemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSS, TQextScintillaLexerDiff, TQextScintillaLexerHTML, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, TQextScintillaLexerSQL, and TQextScintillaLexerTeX.

int TQextScintillaLexer::autoIndentStyle | ( |  | ) |

Returns the auto-indentation style. The default is 0 if the language is block structured, or TQextScintilla::AiMaintain if not.

See also:
  setAutoIndentStyle(), TQextScintilla::AiMaintain, TQextScintilla::AiOpening, TQextScintilla::AiClosing

virtual TQColor TQextScintillaLexer::color | ( | int | style | ) | const`[virtual]`

Returns the foreground colour of the text for style number style. The default colour is black.

See also:
  paper()

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerCSS, TQextScintillaLexerDiff, TQextScintillaLexerHTML, TQextScintillaLexerIDL, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, TQextScintillaLexerSQL, and TQextScintillaLexerTeX.

virtual bool TQextScintillaLexer::eolFill | ( | int | style | ) | const`[virtual]`

Returns the end-of-line for style number style. The default is false.

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerHTML, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, and TQextScintillaLexerSQL.

virtual TQFont TQextScintillaLexer::font | ( | int | style | ) | const`[virtual]`

Returns the font for style number style. The default font is that returned by defaultFont().

See also:
  defaultFont()

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerCSS, TQextScintillaLexerHTML, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, and TQextScintillaLexerSQL.

virtual const char* TQextScintillaLexer::keywords | ( | int | set | ) | const`[virtual]`

Returns the set of keywords for the keyword set set recognised by the lexer as a space separated string. 0 is returned if there is no such set.

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerCSS, TQextScintillaLexerHTML, TQextScintillaLexerIDL, TQextScintillaLexerJava, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerPython, TQextScintillaLexerRuby, TQextScintillaLexerSQL, and TQextScintillaLexerTeX.

virtual TQString TQextScintillaLexer::description | ( | int | style | ) | const`[pure virtual]`

Returns the descriptive name for style number style. If the style is invalid for this language then TQString() is returned. This is intended to be used in user preference dialogs.

Implemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerCSS, TQextScintillaLexerDiff, TQextScintillaLexerHTML, TQextScintillaLexerIDL, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, TQextScintillaLexerSQL, and TQextScintillaLexerTeX.

virtual TQColor TQextScintillaLexer::paper | ( | int | style | ) | const`[virtual]`

Returns the background colour of the text for style number style.

See also:
  defaultPaper(), color()

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerBatch, TQextScintillaLexerCPP, TQextScintillaLexerCSharp, TQextScintillaLexerHTML, TQextScintillaLexerJavaScript, TQextScintillaLexerLua, TQextScintillaLexerMakefile, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, TQextScintillaLexerRuby, and TQextScintillaLexerSQL.

virtual TQFont TQextScintillaLexer::defaultFont | ( |  | ) | const`[virtual]`

Returns the default font for all styles.

See also:
  setDefaultFont()

virtual TQColor TQextScintillaLexer::defaultColor | ( |  | ) | const`[virtual]`

Returns the default text colour for all styles.

See also:
  setDefaultColor()

virtual TQColor TQextScintillaLexer::defaultPaper | ( |  | ) | const`[virtual]`

Returns the default paper colour for all styles.

See also:
  setDefaultPaper()

virtual void TQextScintillaLexer::refreshProperties | ( |  | ) | `[virtual]`

Causes all properties to be refreshed by emitting the propertyChanged() signal as required.

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerCPP, TQextScintillaLexerCSS, TQextScintillaLexerHTML, TQextScintillaLexerLua, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, and TQextScintillaLexerSQL.

bool TQextScintillaLexer::readSettings | ( | TQSettings & | qs,
|  | const char * | prefix = `"/Scintilla"` |
| ) |  |  |

The colour, paper, font and end-of-line for each style number, and all lexer specific properties are read from the settings qs. prefix is prepended to the key of each entry. true is returned if there was no error.

See also:
  writeSettings(), TQextScintilla::setLexer()

bool TQextScintillaLexer::writeSettings | ( | TQSettings & | qs,
|  | const char * | prefix = `"/Scintilla"` |
| ) |  |  | const

The colour, paper, font and end-of-line for each style number, and all lexer specific properties are written to the settings qs. prefix is prepended to the key of each entry. true is returned if there was no error.

See also:
  readSettings()

virtual void TQextScintillaLexer::setAutoIndentStyle | ( | int | autoindentstyle | ) | `[virtual, slot]`

The auto-indentation style is set to autoindentstyle.

See also:
  autoIndentStyle(), TQextScintilla::AiMaintain, TQextScintilla::AiOpening, TQextScintilla::AiClosing

virtual void TQextScintillaLexer::setColor | ( | const TQColor & | c,
|  | int | style = `-1` |
| ) |  |  | `[virtual, slot]`

The foreground colour for style number style is set to c. If style is -1 then the colour is set for all styles.

virtual void TQextScintillaLexer::setDefaultFont | ( | const TQFont & | f | ) | `[virtual, slot]`

The default font for all styles is set to f.

See also:
  defaultFont()

virtual void TQextScintillaLexer::setDefaultColor | ( | const TQColor & | c | ) | `[virtual, slot]`

The default text colour for all styles is set to c.

See also:
  defaultColor(), color()

virtual void TQextScintillaLexer::setDefaultPaper | ( | const TQColor & | c | ) | `[virtual, slot]`

The default paper colour for all styles is set to c.

See also:
  defaultPaper(), paper()

virtual void TQextScintillaLexer::setEolFill | ( | bool | eoffill,
|  | int | style = `-1` |
| ) |  |  | `[virtual, slot]`

The end-of-line fill for style number style is set to eoffill. If style is -1 then the fill is set for all styles.

virtual void TQextScintillaLexer::setFont | ( | const TQFont & | f,
|  | int | style = `-1` |
| ) |  |  | `[virtual, slot]`

The font for style number style is set to f. If style is -1 then the font is set for all styles.

virtual void TQextScintillaLexer::setPaper | ( | const TQColor & | c,
|  | int | style = `-1` |
| ) |  |  | `[virtual, slot]`

The background colour for style number style is set to c. If style is -1 then the colour is set for all styles.

void TQextScintillaLexer::colorChanged | ( | const TQColor & | c,
|  | int | style |
| ) |  |  | `[signal]`

This signal is emitted when the foreground colour of style number style has changed. The new colour is c.

void TQextScintillaLexer::eolFillChanged | ( | bool | eoffilled,
|  | int | style |
| ) |  |  | `[signal]`

This signal is emitted when the end-of-file fill of style number style has changed. The new fill is eoffilled.

void TQextScintillaLexer::fontChanged | ( | const TQFont & | f,
|  | int | style |
| ) |  |  | `[signal]`

This signal is emitted when the font of style number style has changed. The new font is f.

void TQextScintillaLexer::paperChanged | ( | const TQColor & | c,
|  | int | style |
| ) |  |  | `[signal]`

This signal is emitted when the background colour of style number style has changed. The new colour is c.

void TQextScintillaLexer::propertyChanged | ( | const char * | prop,
|  | const char * | val |
| ) |  |  | `[signal]`

This signal is emitted when the value of the lexer property prop needs to be changed. The new value is val.

virtual bool TQextScintillaLexer::readProperties | ( | TQSettings & | qs,
|  | const TQString & | prefix |
| ) |  |  | `[protected, virtual]`

The lexer's properties are read from the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. true is returned if there is no error.

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerCPP, TQextScintillaLexerCSS, TQextScintillaLexerHTML, TQextScintillaLexerLua, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, and TQextScintillaLexerSQL.

virtual bool TQextScintillaLexer::writeProperties | ( | TQSettings & | qs,
|  | const TQString & | prefix |
| ) |  |  | const`[protected, virtual]`

The lexer's properties are written to the settings qs. prefix (which has a trailing '/') should be used as a prefix to the key of each setting. true is returned if there is no error.

Reimplemented in TQextScintillaLexerBash, TQextScintillaLexerCPP, TQextScintillaLexerCSS, TQextScintillaLexerHTML, TQextScintillaLexerLua, TQextScintillaLexerPerl, TQextScintillaLexerPOV, TQextScintillaLexerProperties, TQextScintillaLexerPython, and TQextScintillaLexerSQL.