4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Asger Alstrup
8 * \author Lars Gullik Bjønnes
9 * \author Matthias Ettrich
10 * \author Jean-Marc Lasgouttes
11 * \author Angus Leeming
13 * \author André Pönitz
14 * \author Martin Vermeer
16 * Full author contact details are available in file CREDITS.
22 #include <boost/scoped_ptr.hpp>
26 This is a stateless class.
28 It has one basic purposes:
29 To serve as a color-namespace container (the Color enum).
36 * A class holding color definitions and associated names for
37 * LaTeX, X11, the GUI, and LyX internally.
39 * A color can be one of the following kinds:
41 * - A real, predefined color, such as black, white, red or green.
42 * - A logical color, such as no color, inherit, math
46 // made copyable for same reasons as LyXRC was made copyable. See there for
50 /// Names of colors, including all logical colors
52 /// No particular color---clear or default
54 /// The different text colors
71 // Needed interface colors
79 /// Background color of selected text
81 /// Text color in LaTeX mode
83 /// The color used for previews
86 /// Text color for notes
88 /// Background color of notes
90 /// Text color for comments
92 /// Background color of comments
94 /// Text color for greyedout inset
96 /// Background color of greyedout inset
100 /// Color for the depth bars in the margin
102 /// Color for marking foreign language words
105 /// Text color for command insets
107 /// Background color for command insets
109 /// Frame color for command insets
112 /// Special chars text color
115 /// Graphics inset background color
117 /// Math inset text color
119 /// Math inset background color
121 /// Macro math inset background color
123 /// Math inset frame color
128 /// caption frame color
131 /// collapsable insets text
133 /// collapsable insets frame
136 /// Inset marker background color
138 /// Inset marker frame color
141 /// Error box text color
145 /// Added space colour
147 /// Appendix marker color
155 /// Top and bottom line color
161 /// Bottom area color
166 // FIXME: why are the next four separate ??
167 /// Color used for top of boxes
169 /// Color used for bottom of boxes
171 /// Color used for left side of boxes
173 /// Color used for right side of boxes
175 /// Color used for bottom background
178 // Logical attributes
180 /// Color is inherited
182 /// For ignoring updates of a color
190 LColor(LColor const &);
194 void operator=(LColor const &);
196 /** set the given LyX color to the color defined by the X11 name given
197 * \returns true if successful.
199 bool setColor(LColor::color col, std::string const & x11name);
201 /// Get the GUI name of \c color.
202 std::string const getGUIName(LColor::color c) const;
204 /// Get the X11 name of \c color.
205 std::string const getX11Name(LColor::color c) const;
207 /// Get the LaTeX name of \c color.
208 std::string const getLaTeXName(LColor::color c) const;
210 /// Get the LyX name of \c color.
211 std::string const getLyXName(LColor::color c) const;
213 /// \returns the LColor::color associated with the GUI name.
214 LColor::color getFromGUIName(std::string const & guiname) const;
215 /// \returns the LColor::color associated with the LyX name.
216 LColor::color getFromLyXName(std::string const & lyxname) const;
219 void addColor(LColor::color c, std::string const & lyxname) const;
223 boost::scoped_ptr<Pimpl> pimpl_;
227 /** \c LColor_color is a wrapper for LColor::color. It can be forward-declared and
228 * passed as a function argument without having to expose LColor.h.
233 /** The default constructor is nasty,
234 * but allows us to use LColor_color in STL containers.
236 LColor_color() : val_(static_cast<LColor::color>(-1)) {}
238 LColor_color(LColor::color val) : val_(val) {}
239 operator LColor::color() const{ return val_; }
243 /// the current color definitions
244 extern LColor lcolor;
245 /// the system color definitions
246 extern LColor system_lcolor;