Source-highlight Library
textstyleformatterfactory.h
1//
2// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
3//
4// Copyright: See COPYING file that comes with this distribution
5//
6
7#ifndef TEXTSTYLEFORMATTERFACTORY_H_
8#define TEXTSTYLEFORMATTERFACTORY_H_
9
10#include <string>
11#include <list>
12#include <boost/shared_ptr.hpp>
13
14#include "formatterfactory.h"
15#include "textstyles.h"
16#include "textstyleformattercollection.h"
17
18namespace srchilite {
19
20using std::string;
21
22class PreFormatter;
23class CTagsFormatter;
24class FormatterManager;
25class TextStyleFormatter;
26
33
36
39
42
45
46public:
51
62 bool createFormatter(const string &key, const string &color,
63 const string &bgcolor, StyleConstantsPtr styleconstants);
64
71 string preprocessColor(const string &color);
72
80 bool createMissingFormatter(const string &key1, const string &key2);
81
88
89 const TextStyleFormatterCollection &getFormatterCollection() const {
91 }
92};
93
94}
95
96#endif /*TEXTSTYLEFORMATTERFACTORY_H_*/
Formatter for information gathered from ctags.
Definition: ctagsformatter.h:50
The generic abstract factory to create Formatter objects, during the parsing of style files.
Definition: formatterfactory.h:44
Associates to an element name the corresponding formatter.
Definition: formattermanager.h:24
Preformats text to be generated.
Definition: preformatter.h:31
Generates TextStyleFormatters based on TextStyles.
Definition: textstyleformatterfactory.h:30
TextStyleFormatterCollection formatterCollection
all the formatters that are created by this factory
Definition: textstyleformatterfactory.h:44
PreFormatter * preformatter
to preformat text
Definition: textstyleformatterfactory.h:35
string preprocessColor(const string &color)
Check whether the color must be translated with the color map or left as it is (in that case,...
Definition: textstyleformatterfactory.cpp:119
FormatterManager * formatterManager
the formatter manager (associating a formatter to an element)
Definition: textstyleformatterfactory.h:41
CTagsFormatter * ctagsFormatter
for ctgas reference generation (can be null)
Definition: textstyleformatterfactory.h:38
void addDefaultFormatter()
Adds the formatter for the normal style if not already present.
Definition: textstyleformatterfactory.cpp:144
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 ke...
Definition: textstyleformatterfactory.cpp:126
TextStylesPtr textStyles
contains all the styles for formatting
Definition: textstyleformatterfactory.h:32
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 param...
Definition: textstyleformatterfactory.cpp:30
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
boost::shared_ptr< TextStyles > TextStylesPtr
shared pointer
Definition: textstyles.h:77
std::list< TextStyleFormatter * > TextStyleFormatterCollection
Collection of TextStyleFormatter objects.
Definition: textstyleformattercollection.h:8
boost::shared_ptr< StyleConstants > StyleConstantsPtr
shared pointer for StyleConstants
Definition: formatterfactory.h:32