]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/lcolorcache.h
some tabular fixes for the problems reported by Helge
[lyx.git] / src / frontends / qt2 / lcolorcache.h
1 // -*- C++ -*-
2 /**
3  * \file lcolorcache.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LCOLORCACHE_H
13 #define LCOLORCACHE_H
14
15 #include "LColor.h"
16
17 #include <map>
18
19 #include <qcolor.h>
20
21
22 // FIXME: use a fixed-size array not a map ?
23
24 /**
25  * Cache from LColor to QColor.
26  */
27 class LColorCache {
28 public:
29         LColorCache();
30
31         /// get the given color
32         QColor const & get(LColor_color color) const;
33
34         /// clear all colors
35         void clear();
36
37 private:
38         typedef std::map<LColor_color, QColor> lcolor_map;
39
40         mutable lcolor_map colormap;
41 };
42
43 /// singleton instance
44 extern LColorCache lcolorcache;
45
46 #endif // LCOLORCACHE_H