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. More... | |
SyntaxHighlighter (QObject *parent) | |
Constructs a syntax highlighter. More... | |
virtual | ~SyntaxHighlighter () |
Destroys this object. More... | |
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.
|
protected |
SyntaxHighlighter::SyntaxHighlighter | ( | QObject * | parent | ) |
Constructs a syntax highlighter.
|
virtual |
Destroys this object.
QColor SyntaxHighlighter::color | ( | const QString & | type | ) |
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 ArchSite.Compass::buildCoordinates(), draftviewproviders.view_dimension.ViewProviderLinearDimension::draw_dim_arrows(), draftviewproviders.view_dimension.ViewProviderAngularDimension::draw_dim_arrows(), draftviewproviders.view_dimension.ViewProviderLinearDimension::draw_dim_overshoot(), draftviewproviders.view_dimension.ViewProviderLinearDimension::draw_ext_overshoot(), draftguitools.gui_trimex.Trimex::finish(), importSVG.svgHandler::format(), DraftGui.DraftToolBar::getcol(), DraftGui.DraftToolBar::getDefaultColor(), PathScripts.PathDressupDogbone.Marker::highlight(), Gui::PythonConsoleHighlighter::highlightBlock(), PathScripts.PathDressupDogbone.Marker::lowlight(), ArchPanel.ViewProviderPanelCut::onChanged(), ArchPanel.ViewProviderPanelSheet::onChanged(), draftviewproviders.view_dimension.ViewProviderLinearDimension::onChanged(), draftviewproviders.view_dimension.ViewProviderAngularDimension::onChanged(), FeaturePython.ViewProviderOctahedron::onChanged(), Mod.Test.unittestgui.ProgressBar::paint(), setColor(), draftguitools.gui_trackers.editTracker::setColor(), PathScripts.PathDressupTagGui.HoldingTagMarker::setEnabled(), and DraftGui.DraftToolBar::setStyleButton().
|
protected |
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(), FemGui::AbaqusHighlighter::highlightBlock(), and RaytracingGui::PovrayHighlighter::highlightBlock().
|
protectedvirtual |
Reimplemented in Gui::PythonConsoleHighlighter.
Referenced by setColor().
int SyntaxHighlighter::maximumUserState | ( | ) | const |
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.
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, and Gui::SyntaxHighlighterP::cOutput.
Referenced by Gui::Dialog::DlgSettingsEditorImp::loadSettings(), Gui::Dialog::DlgSettingsEditorImp::on_colorButton_changed(), Gui::PythonConsole::OnChange(), and Gui::TextEditor::OnChange().