]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/ColorCache.h
Compil fix.
[lyx.git] / src / frontends / qt4 / ColorCache.h
1 // -*- C++ -*-
2 /**
3  * \file ColorCache.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 COLORCACHE_H
13 #define COLORCACHE_H
14
15 #include "ColorCode.h"
16
17 #include <QColor>
18
19 namespace lyx {
20
21 struct RGBColor;
22
23 /**
24  * Cache from Color to QColor.
25  */
26 class ColorCache
27 {
28 public:
29         ColorCache() { init(); }
30
31         /// get the given color
32         QColor const & get(ColorCode color) const { return lcolors_[color]; }
33
34         /// clear all colors
35         void clear() { init(); }
36
37 private:
38         ///
39         void init();
40         ///
41         QColor lcolors_[Color_ignore + 1];
42 };
43
44 ///
45 QColor const rgb2qcolor(RGBColor const &);
46
47 } // namespace lyx
48
49 #endif // COLORCACHE_H