QScintilla  2.10
Public Member Functions | List of all members
QsciLexerCustom Class Referenceabstract

#include <qscilexercustom.h>

Inherits QsciLexer.

Public Member Functions

 QsciLexerCustom (QObject *parent=0)
 
virtual ~QsciLexerCustom ()
 
void setStyling (int length, int style)
 
void setStyling (int length, const QsciStyle &style)
 
void startStyling (int pos, int styleBits=0)
 
virtual void styleText (int start, int end)=0
 
virtual void setEditor (QsciScintilla *editor)
 
virtual int styleBitsNeeded () const
 
- Public Member Functions inherited from QsciLexer
 QsciLexer (QObject *parent=0)
 
virtual ~QsciLexer ()
 
virtual const char * language () const =0
 
virtual const char * lexer () const
 
virtual int lexerId () const
 
QsciAbstractAPIsapis () const
 
virtual const char * autoCompletionFillups () const
 
virtual QStringList autoCompletionWordSeparators () 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 bool caseSensitive () const
 
virtual QColor color (int style) const
 
virtual bool eolFill (int style) const
 
virtual QFont font (int style) const
 
virtual int indentationGuideView () const
 
virtual const char * keywords (int set) const
 
virtual int defaultStyle () const
 
virtual QString description (int style) const =0
 
virtual QColor paper (int style) const
 
QColor defaultColor () const
 
virtual QColor defaultColor (int style) const
 
virtual bool defaultEolFill (int style) const
 
QFont defaultFont () const
 
virtual QFont defaultFont (int style) const
 
QColor defaultPaper () const
 
virtual QColor defaultPaper (int style) const
 
QsciScintillaeditor () const
 
void setAPIs (QsciAbstractAPIs *apis)
 
void setDefaultColor (const QColor &c)
 
void setDefaultFont (const QFont &f)
 
void setDefaultPaper (const QColor &c)
 
bool readSettings (QSettings &qs, const char *prefix="/Scintilla")
 
virtual void refreshProperties ()
 
virtual const char * wordCharacters () const
 
bool writeSettings (QSettings &qs, const char *prefix="/Scintilla") const
 

Additional Inherited Members

- Public Slots inherited from QsciLexer
virtual void setAutoIndentStyle (int autoindentstyle)
 
virtual void setColor (const QColor &c, int style=-1)
 
virtual void setEolFill (bool eoffill, int style=-1)
 
virtual void setFont (const QFont &f, int style=-1)
 
virtual void setPaper (const QColor &c, int style=-1)
 
- Signals inherited from QsciLexer
void colorChanged (const QColor &c, int style)
 
void eolFillChanged (bool eolfilled, int style)
 
void fontChanged (const QFont &f, int style)
 
void paperChanged (const QColor &c, int style)
 
void propertyChanged (const char *prop, const char *val)
 
- Protected Member Functions inherited from QsciLexer
virtual bool readProperties (QSettings &qs, const QString &prefix)
 
virtual bool writeProperties (QSettings &qs, const QString &prefix) const
 

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)

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

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  styleBits = 0 
)

The styling position is set to start. styleBits is unused.

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(), QsciScintilla::bytes(), QsciScintilla::text()
virtual int QsciLexerCustom::styleBitsNeeded ( ) const
virtual

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

Reimplemented from QsciLexer.