Source-highlight Qt Library
TextFormatterFactory.h
1 /*
2  * Copyright (C) 2008-2010 Lorenzo Bettini, http://www.lorenzobettini.it
3  * License: See COPYING file that comes with this distribution
4  */
5 
6 #ifndef TEXTFORMATTERFACTORY_H_
7 #define TEXTFORMATTERFACTORY_H_
8 
9 #include <map>
10 
11 #include "srchilite/formatterfactory.h"
12 
13 #include "TextFormatter.h"
14 #include "QtColorMap.h"
15 
16 namespace srchiliteqt {
17 
18 using std::string;
19 
20 typedef std::map<string, TextFormatterPtr> TextFormatterMap;
21 
26 class TextFormatterFactory: public srchilite::FormatterFactory {
27 protected:
28  TextFormatterMap textFormatterMap;
29 
32 
33 public:
36 
38  virtual ~TextFormatterFactory();
39 
46  bool hasFormatter(const string &key) const;
47 
53  TextFormatterPtr getFormatter(const string &key) const;
54 
60  void addFormatter(const string &key, TextFormatterPtr formatter);
61 
65  const TextFormatterMap &getTextFormatterMap() const {
66  return textFormatterMap;
67  }
68 
69  bool isDefaultToMonospace() const {
70  return defaultToMonospace;
71  }
72 
79  void setDefaultToMonospace(bool d) {
81  }
82 };
83 
84 }
85 
86 #endif /* TEXTFORMATTERFACTORY_H_ */