HSyntaxHighlighterSettings Class Reference

Highlighting Settings This class holds all Highlighting settings, used by HSyntaxHighlighter It is used to generate formating rules. slFormatingRule mlFormatingRule HSyntaxHighlighterDialog. More...

#include <HSyntaxHighlighterSettings.h>

List of all members.

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< slFormatingRulegetSingleLineRules () const
 Generates single line rules This function generates single line rules for HSyntaxHighlighter.
QVector< mlFormatingRulegetMultiLinesRules () 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< SingleLineHighlightBlocksingleLine
 Vector of single lines block, contains SingleLineHighlightBlock.
QVector< MultiLinesHighlightBlockmultiLines
 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


Detailed Description

Highlighting Settings This class holds all Highlighting settings, used by HSyntaxHighlighter It is used to generate formating rules. slFormatingRule mlFormatingRule HSyntaxHighlighterDialog.

Definition at line 64 of file HSyntaxHighlighterSettings.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.

Returns:
True if settings were modified.

Definition at line 96 of file HSyntaxHighlighterSettings.h.

References modified.

Referenced by HSyntaxHighlighter::highlightBlock().

QVector< mlFormatingRule > HSyntaxHighlighterSettings::getMultiLinesRules (  )  const

QVector< slFormatingRule > HSyntaxHighlighterSettings::getSingleLineRules (  )  const

Generates single line rules This function generates single line rules for HSyntaxHighlighter.

Returns:
QVector of slFormatingRule class rules.

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.

Parameters:
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.

Parameters:
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

Parameters:
_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

Parameters:
_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

Parameters:
_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

Parameters:
_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

Parameters:
_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

Parameters:
_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().


Friends And Related Function Documentation

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.


Member Data Documentation

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().


The documentation for this class was generated from the following files:

Generated on Fri Jan 9 00:51:00 2009 for HSyntaxHighlighter by  doxygen 1.5.8