]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/lcolorcache.h
rename LFUN enum values according to their command (as used in th minibuffer/bind...
[lyx.git] / src / frontends / qt4 / 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>
20
21
22 namespace lyx {
23 struct RGBColor;
24 }
25
26
27 // FIXME: use a fixed-size array not a map ?
28
29 /**
30  * Cache from LColor to QColor.
31  */
32 class LColorCache {
33 public:
34         LColorCache();
35
36         /// get the given color
37         QColor const & get(LColor_color color) const;
38
39         /// clear all colors
40         void clear();
41
42 private:
43         typedef std::map<LColor_color, QColor> lcolor_map;
44
45         mutable lcolor_map colormap;
46 };
47
48 /// singleton instance
49 extern LColorCache lcolorcache;
50
51 ///
52 QColor const rgb2qcolor(lyx::RGBColor const &);
53 #endif // LCOLORCACHE_H