/usr/include/srchilite/textstyleformatterfactory.h is in libsource-highlight-dev 3.1.8-1.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | //
// Author: Lorenzo Bettini <http://www.lorenzobettini.it>, (C) 2004-2008
//
// Copyright: See COPYING file that comes with this distribution
//
#ifndef TEXTSTYLEFORMATTERFACTORY_H_
#define TEXTSTYLEFORMATTERFACTORY_H_
#include <string>
#include <list>
#include <boost/shared_ptr.hpp>
#include "formatterfactory.h"
#include "textstyles.h"
#include "textstyleformattercollection.h"
namespace srchilite {
using std::string;
class PreFormatter;
class CTagsFormatter;
class FormatterManager;
class TextStyleFormatter;
/**
* Generates TextStyleFormatters based on TextStyles
*/
class TextStyleFormatterFactory : public FormatterFactory {
/// contains all the styles for formatting
TextStylesPtr textStyles;
/// to preformat text
PreFormatter *preformatter;
/// for ctgas reference generation (can be null)
CTagsFormatter *ctagsFormatter;
/// the formatter manager (associating a formatter to an element)
FormatterManager *formatterManager;
/// all the formatters that are created by this factory
TextStyleFormatterCollection formatterCollection;
public:
TextStyleFormatterFactory(TextStylesPtr textStyles,
PreFormatter *preformatter, CTagsFormatter *ctagsFormatter,
FormatterManager *formatterManager);
~TextStyleFormatterFactory();
/**
* Creates a formatter for the specific language element (identified by
* key) with the passed style parameters
*
* @param key
* @param color
* @param bgcolor
* @param styleconstants
* @return false if a formatter for the specific key is already present
*/
bool createFormatter(const string &key, const string &color,
const string &bgcolor, StyleConstantsPtr styleconstants);
/**
* Check whether the color must be translated with the color map or
* left as it is (in that case, remove the ")
* @param color
* @return
*/
string preprocessColor(const string &color);
/**
* Creates a formatter for key1, if not already present, that has the same
* style as the formatter for key2
*
* @return false if the formatter for key1 is already present, or there's
* no formatter for key2
*/
bool createMissingFormatter(const string &key1, const string &key2);
/**
* 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
*/
void addDefaultFormatter();
const TextStyleFormatterCollection &getFormatterCollection() const {
return formatterCollection;
}
};
}
#endif /*TEXTSTYLEFORMATTERFACTORY_H_*/
|