]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/ColorCache.h
QDialogButtonBox for the remaining dialogs.
[lyx.git] / src / frontends / qt4 / ColorCache.h
index 54768f612443b21e98ece648f5b113a139088e16..e1ad6aed5eaea665ca46ec07f6d2bb0b977cc111 100644 (file)
 #ifndef COLORCACHE_H
 #define COLORCACHE_H
 
-#include "ColorCode.h"
+#include "Color.h"
 
 #include <QColor>
+#include <QPalette>
 
 namespace lyx {
 
@@ -26,19 +27,33 @@ struct RGBColor;
 class ColorCache
 {
 public:
-       ColorCache() { init(); }
+       ///
+       ColorCache() : initialized_(false) {}
+
+       /// get the given color (depends on LyXRC::use_system_color)
+       QColor get(Color const & color) const;
 
        /// get the given color
-       QColor const & get(ColorCode color) const { return lcolors_[color]; }
+       QColor get(Color const & color, bool use_system_colors) const;
+
+       /// is this color replaced when LyXRC::use_system_color is true?
+       bool isSystem(ColorCode color) const;
+
+       /// change the undelying palette
+       void setPalette(QPalette const pal) { pal_ = pal; clear(); }
 
        /// clear all colors
-       void clear() { init(); }
+       void clear() { initialized_ = false; }
 
 private:
        ///
        void init();
        ///
        QColor lcolors_[Color_ignore + 1];
+       ///
+       bool initialized_;
+       ///
+       QPalette pal_;
 };
 
 ///