6 #ifndef GNUSYNTAXHIGHLIGHTER_H_ 7 #define GNUSYNTAXHIGHLIGHTER_H_ 9 #include <srchilite/highlightstate.h> 10 #include <srchilite/formattermanager.h> 11 #include <srchilite/sourcehighlighter.h> 12 #include <srchilite/formatterparams.h> 13 #include <srchilite/langdefmanager.h> 14 #include <srchilite/langmap.h> 16 #include "TextFormatterFactory.h" 17 #include "HighlightStateData.h" 61 const QString &getLangFile()
const {
return langFile; }
112 const QString &styleFile =
"default.style");
170 void setForegroundColor(
const QString &f) {
174 void setBackgroundColor(
const QString &b) {
196 bool isDefaultToMonospace()
const {
207 defaultToMonospace = d;
void setDefaultToMonospace(bool d)
Whether the highlighter should use monospace font by default if nothing is specified about the font f...
Definition: GNUSyntaxHighlighter.h:206
Definition: ColorDialog.cpp:12
srchilite::SourceHighlighter * sourceHighlighter
the GNU Source-highlighter used for the actual highlighting
Definition: GNUSyntaxHighlighter.h:31
srchilite::LangMap * getOutLangMap() const
Definition: GNUSyntaxHighlighter.cpp:50
srchilite::SourceHighlighter * getHighlighter() const
Definition: GNUSyntaxHighlighter.h:93
const QString & getBackgroundColor() const
Definition: GNUSyntaxHighlighter.h:166
const QString getLangDefFileFromFileName(const QString &filename)
Returns the the lang def file name by using the file name for detecting the syntax of the file (e...
Definition: GNUSyntaxHighlighter.cpp:76
void initHighlighter(const QString &file)
Given a language definition file name, initializes the Source-highlight's highlighter.
Definition: GNUSyntaxHighlighter.cpp:61
srchilite::HighlightStatePtr getHighlightState(const QString &file)
Given a language definition file name, returns the corresponding highlight state. ...
Definition: GNUSyntaxHighlighter.cpp:56
bool isReadOnly() const
Definition: GNUSyntaxHighlighter.h:181
srchilite::FormatterManager * formatterManager
This will be used by subclasses to generate the right table of formatters.
Definition: GNUSyntaxHighlighter.h:55
QString foregroundColor
the color string for foreground
Definition: GNUSyntaxHighlighter.h:40
srchilite::FormatterManager * getFormatterManager() const
Definition: GNUSyntaxHighlighter.h:117
Specialization of FormatterFactory to create TextFormatter objects to format text in a TextEdit...
Definition: TextFormatterFactory.h:26
void setReadOnly(bool r)
Specifies that we highlight readonly contents.
Definition: GNUSyntaxHighlighter.h:192
QString langFile
the lang file used by this highlighter
Definition: GNUSyntaxHighlighter.h:28
QString backgroundColor
the color string for background
Definition: GNUSyntaxHighlighter.h:43
Utility class to deal with current highlighting state (and stack of states)
Definition: HighlightStateData.h:16
srchilite::LangMap * getLangMap() const
Definition: GNUSyntaxHighlighter.cpp:44
bool readOnly
whether we highlight read only contents
Definition: GNUSyntaxHighlighter.h:46
const QString & getForegroundColor() const
Definition: GNUSyntaxHighlighter.h:159
void highlightLine(const QString &line, HighlightStateData *&stateData)
Highlights the passed line.
Definition: GNUSyntaxHighlighter.cpp:110
An abstract class using GNU Source-highlight library to perform syntax highlighting.
Definition: GNUSyntaxHighlighter.h:26
srchilite::FormatterParams formatterParams
this is crucial to get the starting position of the string to highlight within the whole line ...
Definition: GNUSyntaxHighlighter.h:37
const TextFormatterMap & getTextFormatterMap(TextFormatterFactory &formatterFactory, const QString &styleFile="default.style")
Given a TextFormatterFactory, it uses to build the TextFormatterMap, by reading a specified source-hi...
Definition: GNUSyntaxHighlighter.cpp:81
srchilite::LangDefManager * getLangDefManager() const
Definition: GNUSyntaxHighlighter.cpp:40
bool defaultToMonospace
whether to default font to monospace (default true)
Definition: GNUSyntaxHighlighter.h:49