Source-highlight Library
|
Generates TextStyleFormatters based on TextStyles. More...
#include <textstyleformatterfactory.h>
Public Member Functions | |
TextStyleFormatterFactory (TextStylesPtr textStyles, PreFormatter *preformatter, CTagsFormatter *ctagsFormatter, FormatterManager *formatterManager) | |
bool | createFormatter (const string &key, const string &color, const string &bgcolor, StyleConstantsPtr styleconstants) |
Creates a formatter for the specific language element (identified by key) with the passed style parameters. More... | |
string | preprocessColor (const string &color) |
Check whether the color must be translated with the color map or left as it is (in that case, remove the ") More... | |
bool | createMissingFormatter (const string &key1, const string &key2) |
Creates a formatter for key1, if not already present, that has the same style as the formatter for key2. More... | |
void | addDefaultFormatter () |
Adds the formatter for the normal style if not already present. More... | |
const TextStyleFormatterCollection & | getFormatterCollection () const |
Private Attributes | |
TextStylesPtr | textStyles |
contains all the styles for formatting | |
PreFormatter * | preformatter |
to preformat text | |
CTagsFormatter * | ctagsFormatter |
for ctgas reference generation (can be null) | |
FormatterManager * | formatterManager |
the formatter manager (associating a formatter to an element) | |
TextStyleFormatterCollection | formatterCollection |
all the formatters that are created by this factory | |
Generates TextStyleFormatters based on TextStyles.
void srchilite::TextStyleFormatterFactory::addDefaultFormatter | ( | ) |
Adds the formatter for the normal style if not already present.
This must be called after all the formatter for the language elements were generated
|
virtual |
Creates a formatter for the specific language element (identified by key) with the passed style parameters.
key | |
color | |
bgcolor | |
styleconstants |
Implements srchilite::FormatterFactory.
bool srchilite::TextStyleFormatterFactory::createMissingFormatter | ( | const string & | key1, |
const string & | key2 | ||
) |
Creates a formatter for key1, if not already present, that has the same style as the formatter for key2.
string srchilite::TextStyleFormatterFactory::preprocessColor | ( | const string & | color | ) |
Check whether the color must be translated with the color map or left as it is (in that case, remove the ")
color |