]> git.tdb.fi Git - poefilter.git/blob - source/theme.h
Associate categories and appearances at filter level
[poefilter.git] / source / theme.h
1 #ifndef THEME_H_
2 #define THEME_H_
3
4 #include <map>
5 #include <string>
6 #include <msp/datafile/objectloader.h>
7 #include "appearance.h"
8 #include "color.h"
9
10 class Theme
11 {
12 public:
13         class Loader: public Msp::DataFile::ObjectLoader<Theme>
14         {
15         public:
16                 Loader(Theme &);
17
18         private:
19                 void appearance(const std::string &);
20                 void color(const std::string &, unsigned, unsigned, unsigned);
21         };
22
23 private:
24         typedef std::map<std::string, Color> ColorMap;
25         typedef std::map<std::string, Appearance> AppearanceMap;
26
27         ColorMap colors;
28         unsigned base_font_size;
29         AppearanceMap appearances;
30
31 public:
32         Theme();
33
34         void set_color(const std::string &, const Color &);
35         const Color &get_color(const std::string &) const;
36
37         void set_base_font_size(unsigned);
38         unsigned get_base_font_size() const { return base_font_size; }
39
40         void set_appearance(const std::string &, const Appearance &);
41         const Appearance &get_appearance(const std::string &) const;
42         const Appearance *find_appearance(const std::string &) const;
43 };
44
45 #endif