]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/ColorCache.h
Reverse unwanted commits.
[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() : initialized_(false) {}
30
31         /// get the given color
32         QColor get(ColorCode color) const;
33
34         /// clear all colors
35         void clear() { initialized_ = false; }
36
37 private:
38         ///
39         void init();
40         ///
41         QColor lcolors_[Color_ignore + 1];
42         ///
43         bool initialized_;
44 };
45
46 ///
47 QColor const rgb2qcolor(RGBColor const &);
48
49 } // namespace lyx
50
51 #endif // COLORCACHE_H