Abstract Syntax highlighter. More...
#include <SyntaxHighlighter.h>
Public Member Functions | |
QColor | color (const QString &type) |
int | maximumUserState () const |
void | setColor (const QString &type, const QColor &col) |
Sets the color col to the paragraph type type. | |
SyntaxHighlighter (QObject *parent) | |
Constructs a syntax highlighter. | |
virtual | ~SyntaxHighlighter () |
Destroys this object. | |
Protected Types | |
enum | TColor { Text = 0, Comment = 1, BlockComment = 2, Number = 3, String = 4, Keyword = 5, Classname = 6, Defname = 7, Operator = 8, Output = 9, Error = 10 } |
Protected Member Functions | |
QColor | colorByType (TColor type) |
virtual void | colorChanged (const QString &type, const QColor &col) |
Abstract Syntax highlighter.
Definition at line 37 of file SyntaxHighlighter.h.
enum Gui::SyntaxHighlighter::TColor [protected] |
Definition at line 52 of file SyntaxHighlighter.h.
SyntaxHighlighter::SyntaxHighlighter | ( | QObject * | parent | ) |
Constructs a syntax highlighter.
Definition at line 53 of file SyntaxHighlighter.cpp.
SyntaxHighlighter::~SyntaxHighlighter | ( | ) | [virtual] |
Destroys this object.
Definition at line 60 of file SyntaxHighlighter.cpp.
QColor SyntaxHighlighter::color | ( | const QString & | type | ) |
Definition at line 102 of file SyntaxHighlighter.cpp.
References Gui::SyntaxHighlighterP::cBlockcomment, Gui::SyntaxHighlighterP::cClassName, Gui::SyntaxHighlighterP::cComment, Gui::SyntaxHighlighterP::cDefineName, Gui::SyntaxHighlighterP::cError, Gui::SyntaxHighlighterP::cKeyword, Gui::SyntaxHighlighterP::cLiteral, Gui::SyntaxHighlighterP::cNormalText, Gui::SyntaxHighlighterP::cNumber, Gui::SyntaxHighlighterP::cOperator, and Gui::SyntaxHighlighterP::cOutput.
Referenced by Gui::PythonConsoleHighlighter::highlightBlock(), and setColor().
QColor SyntaxHighlighter::colorByType | ( | SyntaxHighlighter::TColor | type | ) | [protected] |
Definition at line 130 of file SyntaxHighlighter.cpp.
References BlockComment, Gui::SyntaxHighlighterP::cBlockcomment, Gui::SyntaxHighlighterP::cClassName, Gui::SyntaxHighlighterP::cComment, Gui::SyntaxHighlighterP::cDefineName, Gui::SyntaxHighlighterP::cError, Gui::SyntaxHighlighterP::cKeyword, Classname, Gui::SyntaxHighlighterP::cLiteral, Gui::SyntaxHighlighterP::cNormalText, Gui::SyntaxHighlighterP::cNumber, Comment, Gui::SyntaxHighlighterP::cOperator, Gui::SyntaxHighlighterP::cOutput, Defname, Error, Keyword, Number, Operator, Output, String, and Text.
Referenced by Gui::PythonSyntaxHighlighter::highlightBlock(), and RaytracingGui::PovrayHighlighter::highlightBlock().
void SyntaxHighlighter::colorChanged | ( | const QString & | type, | |
const QColor & | col | |||
) | [protected, virtual] |
Reimplemented in Gui::PythonConsoleHighlighter.
Definition at line 158 of file SyntaxHighlighter.cpp.
Referenced by setColor().
int SyntaxHighlighter::maximumUserState | ( | ) | const |
Definition at line 169 of file SyntaxHighlighter.cpp.
Referenced by Gui::PythonConsole::createMimeDataFromSelection(), and Gui::PythonSyntaxHighlighter::highlightBlock().
void SyntaxHighlighter::setColor | ( | const QString & | type, | |
const QColor & | col | |||
) |
Sets the color col to the paragraph type type.
This method is provided for convenience to specify the paragraph type by its name.
Definition at line 69 of file SyntaxHighlighter.cpp.
References Gui::SyntaxHighlighterP::cBlockcomment, Gui::SyntaxHighlighterP::cClassName, Gui::SyntaxHighlighterP::cComment, Gui::SyntaxHighlighterP::cDefineName, Gui::SyntaxHighlighterP::cError, Gui::SyntaxHighlighterP::cKeyword, Gui::SyntaxHighlighterP::cLiteral, Gui::SyntaxHighlighterP::cNormalText, Gui::SyntaxHighlighterP::cNumber, color(), colorChanged(), Gui::SyntaxHighlighterP::cOperator, Gui::SyntaxHighlighterP::cOutput, and UnitParser::if().
Referenced by Gui::Dialog::DlgSettingsEditorImp::loadSettings(), Gui::Dialog::DlgSettingsEditorImp::on_colorButton_changed(), Gui::TextEditor::OnChange(), and Gui::PythonConsole::OnChange().