#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 | addBlock (const QString &_name, HighlightBlock::HighlighType _type=HighlightBlock::sl) |
| adds new empty highlighting block to be filled by user. | |
| bool | blockExists (const QString &_name) const |
| checks if block exists | |
| void | removeBlock (const QString &_name) |
| Removes block if it exists. | |
| void | renameBlock (const QString &_oldName, const QString &_newName) |
Private Attributes | |
| QMap< QString, SingleLineHighlightBlock > | singleLine |
| Map of single lines block indexed by names. | |
| QMap< QString, MultiLinesHighlightBlock > | multiLines |
| Map of multiple lines block indexed by names. | |
| bool | modified |
| variable indicating if settings were modified since last caching, indicated by call to cached() | |
Friends | |
| class | HSyntaxHighlighterDialog |
Definition at line 46 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.
| HSyntaxHighlighterSettings::~HSyntaxHighlighterSettings | ( | ) | [inline] |
Destructor We don't use any raw pointers here, so he has no job.
Definition at line 107 of file HSyntaxHighlighterSettings.h.
| void HSyntaxHighlighterSettings::addBlock | ( | const QString & | _name, | |
| HighlightBlock::HighlighType | _type = HighlightBlock::sl | |||
| ) | [inline] |
adds new empty highlighting block to be filled by user.
| _name | name of the new block | |
| _type |
Definition at line 127 of file HSyntaxHighlighterSettings.h.
References blockExists(), HighlightBlock::ml, modified, multiLines, HighlightBlock::setName(), singleLine, and HighlightBlock::sl.
Referenced by HSyntaxHighlighterNewBlock::addName().
| bool HSyntaxHighlighterSettings::blockExists | ( | const QString & | _name | ) | const [inline] |
checks if block exists
| _name | name of checked block |
Definition at line 152 of file HSyntaxHighlighterSettings.h.
References multiLines, and singleLine.
Referenced by addBlock(), HSyntaxHighlighterNewBlock::addName(), and HSyntaxHighlighterDialog::renameCurrentItem().
| void HSyntaxHighlighterSettings::cached | ( | ) | [inline] |
Function that indicates blocks were cached cached after is called changed() will return false until next modification.
Definition at line 78 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 69 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 144 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 158 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 77 of file HSyntaxHighlighterSettings.cpp.
References HighlightBlock::getName(), modified, multiLines, HighlightBlock::setBackgroundColor(), HighlightBlock::setDescription(), MultiLinesHighlightBlock::setEndingPattern(), HighlightBlock::setFont(), HighlightBlock::setForegroundColor(), HighlightBlock::setName(), SingleLineHighlightBlock::setPattern(), MultiLinesHighlightBlock::setStartingPattern(), and singleLine.
Referenced by HSyntaxHighlighter::HSyntaxHighlighter(), and HSyntaxHighlighter::loadConfig().
| void HSyntaxHighlighterSettings::removeBlock | ( | const QString & | _name | ) | [inline] |
Removes block if it exists.
| _name | Name of block to be removed |
Definition at line 160 of file HSyntaxHighlighterSettings.h.
References modified, multiLines, and singleLine.
Referenced by HSyntaxHighlighterDialog::removeCurrentItem().
| void HSyntaxHighlighterSettings::renameBlock | ( | const QString & | _oldName, | |
| const QString & | _newName | |||
| ) | [inline] |
Definition at line 169 of file HSyntaxHighlighterSettings.h.
References modified, multiLines, HighlightBlock::setName(), and singleLine.
Referenced by HSyntaxHighlighterDialog::renameCurrentItem().
| 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 19 of file HSyntaxHighlighterSettings.cpp.
References HighlightBlock::getBackgroundColor(), HighlightBlock::getDescription(), MultiLinesHighlightBlock::getEndingPattern(), HighlightBlock::getFont(), HighlightBlock::getForegroundColor(), HighlightBlock::getName(), SingleLineHighlightBlock::getPattern(), MultiLinesHighlightBlock::getStartingPattern(), multiLines, and singleLine.
Referenced by HSyntaxHighlighter::saveConfig(), and HSyntaxHighlighter::~HSyntaxHighlighter().
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 53 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 62 of file HSyntaxHighlighterSettings.h.
Referenced by addBlock(), cached(), changed(), HSyntaxHighlighterDialog::getSettings(), HSyntaxHighlighterSettings(), loadConfig(), removeBlock(), and renameBlock().
QMap<QString,MultiLinesHighlightBlock> HSyntaxHighlighterSettings::multiLines [private] |
Map of multiple lines block indexed by names.
Definition at line 56 of file HSyntaxHighlighterSettings.h.
Referenced by addBlock(), blockExists(), HSyntaxHighlighterDialog::constructBlockList(), HSyntaxHighlighterDialog::editedItemChanged(), getMultiLinesRules(), loadConfig(), removeBlock(), renameBlock(), and saveConfig().
QMap<QString,SingleLineHighlightBlock> HSyntaxHighlighterSettings::singleLine [private] |
Map of single lines block indexed by names.
Definition at line 55 of file HSyntaxHighlighterSettings.h.
Referenced by addBlock(), blockExists(), HSyntaxHighlighterDialog::constructBlockList(), HSyntaxHighlighterDialog::editedItemChanged(), getSingleLineRules(), loadConfig(), removeBlock(), renameBlock(), and saveConfig().
1.5.8