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 
18 namespace srchilite {
19 
20 using std::string;
21 
22 class PreFormatter;
23 class CTagsFormatter;
24 class FormatterManager;
25 class TextStyleFormatter;
26 
33 
36 
39 
42 
45 
46 public:
48  PreFormatter *preformatter, CTagsFormatter *ctagsFormatter,
49  FormatterManager *formatterManager);
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 
87  void addDefaultFormatter();
88 
89  const TextStyleFormatterCollection &getFormatterCollection() const {
90  return formatterCollection;
91  }
92 };
93 
94 }
95 
96 #endif /*TEXTSTYLEFORMATTERFACTORY_H_*/
Preformats text to be generated.
Definition: preformatter.h:31
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
boost::shared_ptr< TextStyles > TextStylesPtr
shared pointer
Definition: textstyles.h:77
Associates to an element name the corresponding formatter.
Definition: formattermanager.h:24
C++ class: doctemplate.h.
Definition: bufferedoutput.cpp:13
TextStyleFormatterCollection formatterCollection
all the formatters that are created by this factory
Definition: textstyleformatterfactory.h:44
Formatter for information gathered from ctags.
Definition: ctagsformatter.h:50
void addDefaultFormatter()
Adds the formatter for the normal style if not already present.
Definition: textstyleformatterfactory.cpp:144
boost::shared_ptr< StyleConstants > StyleConstantsPtr
shared pointer for StyleConstants
Definition: formatterfactory.h:32
The generic abstract factory to create Formatter objects, during the parsing of style files...
Definition: formatterfactory.h:44
CTagsFormatter * ctagsFormatter
for ctgas reference generation (can be null)
Definition: textstyleformatterfactory.h:38
PreFormatter * preformatter
to preformat text
Definition: textstyleformatterfactory.h:35
std::list< TextStyleFormatter * > TextStyleFormatterCollection
Collection of TextStyleFormatter objects.
Definition: textstyleformattercollection.h:8
FormatterManager * formatterManager
the formatter manager (associating a formatter to an element)
Definition: textstyleformatterfactory.h:41
Generates TextStyleFormatters based on TextStyles.
Definition: textstyleformatterfactory.h:30
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
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