UniversalIndentGUI 1.2.0
Public Slots | Public Member Functions | Private Attributes
UiGuiHighlighter Class Reference

UiGuiHighlighter used for selecting the syntax highlighter/lexer for the QsciScintilla component. More...

#include <UiGuiHighlighter.h>

Inheritance diagram for UiGuiHighlighter:
Inheritance graph
[legend]

List of all members.

Public Slots

void setColor (const QColor &color, int style=-1)
 Sets the color for the given style.
void setFont (const QFont &font, int style=-1)
 Sets the font for the given style.
void setHighlighterByAction (QAction *highlighterAction)
 This slot handles signals coming from selecting another syntax highlighter.
void setLexerByName (QString lexerName)
 Sets the to be used lexer by giving his name.
int setLexerForExtension (QString extension)
 Sets the lexer that is responsible for the given extension.

Public Member Functions

QStringList getAvailableHighlighters ()
 Returns the available highlighters as QStringList.
bool readCurrentSettings (const char *prefix)
 Read the settings for the current lexer from the settings file.
void turnHighlightOff ()
 Turns the syntax parser off.
void turnHighlightOn ()
 Turns the syntax parser on.
 UiGuiHighlighter (QsciScintilla *parent)
 The constructor initializes some regular expressions and keywords to identify cpp tokens.
void writeCurrentSettings (const char *prefix)
 Write the settings for the current lexer to the settings file.

Private Attributes

QMap< int, QColor > _colorForStyles
QMap< int, QFont > _fontForStyles
bool _highlightningIsOn
QsciLexer * _lexer
QMap< QString, QStringList > _mapHighlighternameToExtension
QsciScintilla * _qsciEditorParent
QSettings * _settings

Detailed Description

UiGuiHighlighter used for selecting the syntax highlighter/lexer for the QsciScintilla component.

Definition at line 35 of file UiGuiHighlighter.h.


Constructor & Destructor Documentation

UiGuiHighlighter::UiGuiHighlighter ( QsciScintilla *  parent)

The constructor initializes some regular expressions and keywords to identify cpp tokens.

Definition at line 88 of file UiGuiHighlighter.cpp.

References _highlightningIsOn, _lexer, _mapHighlighternameToExtension, _qsciEditorParent, _settings, SettingsPaths::getSettingsPath(), and setLexerForExtension().

Here is the call graph for this function:


Member Function Documentation

QStringList UiGuiHighlighter::getAvailableHighlighters ( )

Returns the available highlighters as QStringList.

Definition at line 160 of file UiGuiHighlighter.cpp.

References _mapHighlighternameToExtension.

Referenced by MainWindow::changeEvent(), and MainWindow::createHighlighterMenu().

Here is the caller graph for this function:

bool UiGuiHighlighter::readCurrentSettings ( const char *  prefix)

Read the settings for the current lexer from the settings file.

Definition at line 208 of file UiGuiHighlighter.cpp.

References _colorForStyles, _fontForStyles, _lexer, _settings, setColor(), and setFont().

Referenced by setLexerForExtension(), and turnHighlightOn().

Here is the call graph for this function:

Here is the caller graph for this function:

void UiGuiHighlighter::setColor ( const QColor &  color,
int  style = -1 
) [slot]

Sets the color for the given style.

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

Definition at line 359 of file UiGuiHighlighter.cpp.

References _colorForStyles, and _lexer.

Referenced by readCurrentSettings().

Here is the caller graph for this function:

void UiGuiHighlighter::setFont ( const QFont &  font,
int  style = -1 
) [slot]

Sets the font for the given style.

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

Definition at line 368 of file UiGuiHighlighter.cpp.

References _fontForStyles, and _lexer.

Referenced by readCurrentSettings().

Here is the caller graph for this function:

void UiGuiHighlighter::setHighlighterByAction ( QAction *  highlighterAction) [slot]

This slot handles signals coming from selecting another syntax highlighter.

Definition at line 168 of file UiGuiHighlighter.cpp.

References _mapHighlighternameToExtension, _qsciEditorParent, and setLexerForExtension().

Here is the call graph for this function:

void UiGuiHighlighter::setLexerByName ( QString  lexerName) [slot]

Sets the to be used lexer by giving his name.

Definition at line 377 of file UiGuiHighlighter.cpp.

References _mapHighlighternameToExtension, and setLexerForExtension().

Here is the call graph for this function:

int UiGuiHighlighter::setLexerForExtension ( QString  extension) [slot]

Sets the lexer that is responsible for the given extension.

Sets the proper highlighter / lexer for the given file extension. Returns the index of the used lexer in the list.

Definition at line 385 of file UiGuiHighlighter.cpp.

References _highlightningIsOn, _lexer, _mapHighlighternameToExtension, _qsciEditorParent, readCurrentSettings(), and writeCurrentSettings().

Referenced by MainWindow::loadFile(), setHighlighterByAction(), setLexerByName(), and UiGuiHighlighter().

Here is the call graph for this function:

Here is the caller graph for this function:

void UiGuiHighlighter::turnHighlightOff ( )

Turns the syntax parser off.

Definition at line 191 of file UiGuiHighlighter.cpp.

References _highlightningIsOn, and _qsciEditorParent.

Referenced by MainWindow::turnHighlightOnOff().

Here is the caller graph for this function:

void UiGuiHighlighter::turnHighlightOn ( )

Turns the syntax parser on.

Definition at line 182 of file UiGuiHighlighter.cpp.

References _highlightningIsOn, _lexer, _qsciEditorParent, and readCurrentSettings().

Referenced by MainWindow::turnHighlightOnOff().

Here is the call graph for this function:

Here is the caller graph for this function:

void UiGuiHighlighter::writeCurrentSettings ( const char *  prefix)

Write the settings for the current lexer to the settings file.

Definition at line 293 of file UiGuiHighlighter.cpp.

References _colorForStyles, _fontForStyles, _lexer, and _settings.

Referenced by MainWindow::saveSettings(), and setLexerForExtension().

Here is the caller graph for this function:


Member Data Documentation

QMap<int, QColor> UiGuiHighlighter::_colorForStyles [private]

Definition at line 68 of file UiGuiHighlighter.h.

Referenced by readCurrentSettings(), setColor(), and writeCurrentSettings().

QMap<int, QFont> UiGuiHighlighter::_fontForStyles [private]

Definition at line 67 of file UiGuiHighlighter.h.

Referenced by readCurrentSettings(), setFont(), and writeCurrentSettings().

QsciLexer* UiGuiHighlighter::_lexer [private]
QMap<QString, QStringList> UiGuiHighlighter::_mapHighlighternameToExtension [private]
QsciScintilla* UiGuiHighlighter::_qsciEditorParent [private]
QSettings* UiGuiHighlighter::_settings [private]

Definition at line 70 of file UiGuiHighlighter.h.

Referenced by readCurrentSettings(), UiGuiHighlighter(), and writeCurrentSettings().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines