QsciLexerCustom Class Reference

The QsciLexerCustom class is an abstract class used as a base for new language lexers. More...

#include <qscilexercustom.h>

Inherits QsciLexer.

List of all members.

Public Member Functions


Detailed Description

The QsciLexerCustom class is an abstract class used as a base for new language lexers.

The advantage of implementing a new lexer this way (as opposed to adding the lexer to the underlying Scintilla code) is that it does not require the QScintilla library to be re-compiled. It also makes it possible to integrate external lexers.

All that is necessary to implement a new lexer is to define appropriate styles and to re-implement the styleText() method.


Constructor & Destructor Documentation

QsciLexerCustom::QsciLexerCustom ( QObject *  parent = 0,
const char *  name = 0 
)

Construct a QsciLexerCustom with parent parent and name name. parent is typically the QsciScintilla instance.

virtual QsciLexerCustom::~QsciLexerCustom (  )  [virtual]

Destroy the QSciLexerCustom.


Member Function Documentation

void QsciLexerCustom::setStyling ( int  length,
int  style 
)

The next length characters starting from the current styling position have their style set to style number style. The current styling position is moved. The styling position is initially set by calling startStyling().

See also:
startStyling(), styleText()

void QsciLexerCustom::setStyling ( int  length,
const QsciStyle style 
)

The next length characters starting from the current styling position have their style set to style style. The current styling position is moved. The styling position is initially set by calling startStyling().

See also:
startStyling(), styleText()

void QsciLexerCustom::startStyling ( int  pos,
int  style_bits = 0 
)

The styling position is set to start and the mask of style bits that can be set is set to style_bits. style_bits allows the styling of text to be done over several passes by setting different style bits on each pass. If style_bits is 0 then all style bits (as returned by styleBitsNeeded()) are set.

See also:
setStyling(), styleBitsNeeded(), styleText()

virtual void QsciLexerCustom::styleText ( int  start,
int  end 
) [pure virtual]

This is called when the section of text beginning at position start and up to position end needs to be styled. start will always be at the start of a line. The text is styled by calling startStyling() followed by one or more calls to setStyling(). It must be re-implemented by a sub-class.

See also:
setStyling(), startStyling()

virtual void QsciLexerCustom::setEditor ( QsciScintilla editor  )  [virtual]

Reimplemented from QsciLexer.

virtual int QsciLexerCustom::styleBitsNeeded (  )  const [virtual]

This re-implementation returns 5 as the number of style bits needed.

Reimplemented from QsciLexer.


Generated on Fri Jun 5 10:00:43 2009 for QScintilla by  doxygen 1.5.8