#include <HSyntaxHighlighterSettings.h>
Public Member Functions | |
| bool | changed () const |
| Function indicating if settings were changed, so user should opdate any cached info. | |
| void | cached () |
| Function that indicates blocks were cached cached after is called changed() will return false until next modification. | |
| void | saveConfig (QString fileName=QCoreApplication::applicationDirPath()+"/default.ini") const |
| Functions saves configuration to file This function is used to store all highlighter settings, such as matching patterns and formatting info selected ini file. | |
| void | loadConfig (QString fileName=QCoreApplication::applicationDirPath()+"/default.ini") |
| Functions loads configuration from file This function is used to load all highlighter settings, such as matching patterns and formatting form selected ini file. | |
| HSyntaxHighlighterSettings () | |
| Basic constructor of settings class It only calls setupHighlightBlocks(). | |
| ~HSyntaxHighlighterSettings () | |
| Destructor We don't use any raw pointers here, so he has no job. | |
| QVector< slFormatingRule > | getSingleLineRules () const |
| Generates single line rules This function generates single line rules for HSyntaxHighlighter. | |
| QVector< mlFormatingRule > | getMultiLinesRules () const |
| Generates multiple line rules This function generates multiple line rules for HSyntaxHighlighter. | |
| void | setFont (slHighlightType _type, const QFont &_font) |
| sets Font of specified Block | |
| void | setFont (mlHighlightType _type, const QFont &_font) |
| sets Font of specified Block | |
| void | setForegroundColor (slHighlightType _type, const QColor &_color) |
| sets Background Color of specified Block | |
| void | setForegroundColor (mlHighlightType _type, const QColor &_color) |
| sets Background Color of specified Block | |
| void | setBackgroundColor (slHighlightType _type, const QColor &_color) |
| sets Background Color of specified Block | |
| void | setBackgroundColor (mlHighlightType _type, const QColor &_color) |
| sets Background Color of specified Block | |
Private Member Functions | |
| void | setupHighlightBlocks () |
| Basic block setup Function change size of Vectors storing Highlighting blocks, and then fills some basic info, for each item: name and description. singleLine multiLines HighlightBlock::name HighlightBlock::description. | |
Private Attributes | |
| QVector< SingleLineHighlightBlock > | singleLine |
| Vector of single lines block, contains SingleLineHighlightBlock. | |
| QVector< MultiLinesHighlightBlock > | multiLines |
| Vector of multiple lines block, contains MultiLinesHighlightBlock. | |
| bool | modified |
| variable indicating if settings were modified since last caching, indicated by call to cached() | |
Friends | |
| class | HSyntaxHighlighterDialog |
Definition at line 64 of file HSyntaxHighlighterSettings.h.
| HSyntaxHighlighterSettings::HSyntaxHighlighterSettings | ( | ) |
Basic constructor of settings class It only calls setupHighlightBlocks().
Definition at line 12 of file HSyntaxHighlighterSettings.cpp.
References modified, and setupHighlightBlocks().
| HSyntaxHighlighterSettings::~HSyntaxHighlighterSettings | ( | ) | [inline] |
Destructor We don't use any raw pointers here, so he has no job.
Definition at line 134 of file HSyntaxHighlighterSettings.h.
| void HSyntaxHighlighterSettings::cached | ( | ) | [inline] |
Function that indicates blocks were cached cached after is called changed() will return false until next modification.
Definition at line 105 of file HSyntaxHighlighterSettings.h.
References modified.
Referenced by HSyntaxHighlighter::updateRules().
| bool HSyntaxHighlighterSettings::changed | ( | ) | const [inline] |
Function indicating if settings were changed, so user should opdate any cached info.
Definition at line 96 of file HSyntaxHighlighterSettings.h.
References modified.
Referenced by HSyntaxHighlighter::highlightBlock().
| QVector< mlFormatingRule > HSyntaxHighlighterSettings::getMultiLinesRules | ( | ) | const |
Generates multiple line rules This function generates multiple line rules for HSyntaxHighlighter.
Definition at line 135 of file HSyntaxHighlighterSettings.cpp.
References mlFormatingRule::beginingExp, mlFormatingRule::endingExp, mlFormatingRule::format, MultiLinesHighlightBlock::getEndingExp(), HighlightBlock::getFormat(), MultiLinesHighlightBlock::getStartingExp(), and multiLines.
Referenced by HSyntaxHighlighter::updateRules().
| QVector< slFormatingRule > HSyntaxHighlighterSettings::getSingleLineRules | ( | ) | const |
Generates single line rules This function generates single line rules for HSyntaxHighlighter.
Definition at line 149 of file HSyntaxHighlighterSettings.cpp.
References slFormatingRule::exp, slFormatingRule::format, SingleLineHighlightBlock::getExp(), HighlightBlock::getFormat(), and singleLine.
Referenced by HSyntaxHighlighter::updateRules().
| void HSyntaxHighlighterSettings::loadConfig | ( | QString | fileName = QCoreApplication::applicationDirPath()+"/default.ini" |
) |
Functions loads configuration from file This function is used to load all highlighter settings, such as matching patterns and formatting form selected ini file.
| fileName | complete path to ini file, where settings should be stored. If no specified, Applications directory and name default.ini are assumed. |
Definition at line 85 of file HSyntaxHighlighterSettings.cpp.
References HighlightBlock::getName(), modified, multiLines, HighlightBlock::setBackgroundColor(), MultiLinesHighlightBlock::setEndingPattern(), HighlightBlock::setFont(), HighlightBlock::setForegroundColor(), SingleLineHighlightBlock::setPattern(), MultiLinesHighlightBlock::setStartingPattern(), and singleLine.
Referenced by HSyntaxHighlighter::HSyntaxHighlighter(), and HSyntaxHighlighter::loadConfig().
| void HSyntaxHighlighterSettings::saveConfig | ( | QString | fileName = QCoreApplication::applicationDirPath()+"/default.ini" |
) | const |
Functions saves configuration to file This function is used to store all highlighter settings, such as matching patterns and formatting info selected ini file.
| fileName | complete path to ini file, where settings should be stored. If no specified, Applications directory and name default.ini are assumed. |
Definition at line 44 of file HSyntaxHighlighterSettings.cpp.
References HighlightBlock::getBackgroundColor(), MultiLinesHighlightBlock::getEndingPattern(), HighlightBlock::getFont(), HighlightBlock::getForegroundColor(), HighlightBlock::getName(), SingleLineHighlightBlock::getPattern(), MultiLinesHighlightBlock::getStartingPattern(), multiLines, and singleLine.
Referenced by HSyntaxHighlighter::saveConfig(), and HSyntaxHighlighter::~HSyntaxHighlighter().
| void HSyntaxHighlighterSettings::setBackgroundColor | ( | mlHighlightType | _type, | |
| const QColor & | _color | |||
| ) | [inline] |
sets Background Color of specified Block
| _type | type of Highlighting block | |
| _color | color to use |
Definition at line 204 of file HSyntaxHighlighterSettings.h.
References multiLines.
| void HSyntaxHighlighterSettings::setBackgroundColor | ( | slHighlightType | _type, | |
| const QColor & | _color | |||
| ) | [inline] |
sets Background Color of specified Block
| _type | type of Highlighting block | |
| _color | color to use |
Definition at line 194 of file HSyntaxHighlighterSettings.h.
References singleLine.
| void HSyntaxHighlighterSettings::setFont | ( | mlHighlightType | _type, | |
| const QFont & | _font | |||
| ) | [inline] |
sets Font of specified Block
| _type | type of Highlighting block | |
| _font | font to use |
Definition at line 164 of file HSyntaxHighlighterSettings.h.
References multiLines.
| void HSyntaxHighlighterSettings::setFont | ( | slHighlightType | _type, | |
| const QFont & | _font | |||
| ) | [inline] |
sets Font of specified Block
| _type | type of Highlighting block | |
| _font | font to use |
Definition at line 154 of file HSyntaxHighlighterSettings.h.
References singleLine.
| void HSyntaxHighlighterSettings::setForegroundColor | ( | mlHighlightType | _type, | |
| const QColor & | _color | |||
| ) | [inline] |
sets Background Color of specified Block
| _type | type of Highlighting block | |
| _color | color to use |
Definition at line 184 of file HSyntaxHighlighterSettings.h.
References multiLines.
| void HSyntaxHighlighterSettings::setForegroundColor | ( | slHighlightType | _type, | |
| const QColor & | _color | |||
| ) | [inline] |
sets Background Color of specified Block
| _type | type of Highlighting block | |
| _color | color to use |
Definition at line 174 of file HSyntaxHighlighterSettings.h.
References singleLine.
| void HSyntaxHighlighterSettings::setupHighlightBlocks | ( | ) | [private] |
Basic block setup Function change size of Vectors storing Highlighting blocks, and then fills some basic info, for each item: name and description. singleLine multiLines HighlightBlock::name HighlightBlock::description.
Definition at line 18 of file HSyntaxHighlighterSettings.cpp.
References Keyword, multiLines, MultiLinesComment, NumberConstant, PreprocessorDirective, singleLine, SingleLineCommment, and TextConstant.
Referenced by HSyntaxHighlighterSettings().
friend class HSyntaxHighlighterDialog [friend] |
This class is friend, because HSyntaxHighlighterDialog is a visual interface, and avoiding this friend will cause breaking Settings encapsulation, with getters and setters given to everyone instead of this one class.
Definition at line 71 of file HSyntaxHighlighterSettings.h.
bool HSyntaxHighlighterSettings::modified [private] |
variable indicating if settings were modified since last caching, indicated by call to cached()
Definition at line 89 of file HSyntaxHighlighterSettings.h.
Referenced by cached(), changed(), HSyntaxHighlighterDialog::getSettings(), HSyntaxHighlighterSettings(), and loadConfig().
QVector<MultiLinesHighlightBlock> HSyntaxHighlighterSettings::multiLines [private] |
Vector of multiple lines block, contains MultiLinesHighlightBlock.
Definition at line 74 of file HSyntaxHighlighterSettings.h.
Referenced by getMultiLinesRules(), HSyntaxHighlighterDialog::getSettings(), loadConfig(), saveConfig(), setBackgroundColor(), setFont(), setForegroundColor(), HSyntaxHighlighterDialog::setSettings(), and setupHighlightBlocks().
QVector<SingleLineHighlightBlock> HSyntaxHighlighterSettings::singleLine [private] |
Vector of single lines block, contains SingleLineHighlightBlock.
Definition at line 73 of file HSyntaxHighlighterSettings.h.
Referenced by HSyntaxHighlighterDialog::getSettings(), getSingleLineRules(), loadConfig(), saveConfig(), setBackgroundColor(), setFont(), setForegroundColor(), HSyntaxHighlighterDialog::setSettings(), and setupHighlightBlocks().
1.5.8