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).
34 * A class holding color definitions and associated names for
35 * LaTeX, X11, the GUI, and LyX internally.
37 * A color can be one of the following kinds:
39 * - A real, predefined color, such as black, white, red or green.
40 * - A logical color, such as no color, inherit, math
44 // made copyable for same reasons as LyXRC was made copyable. See there for
48 /// Names of colors, including all logical colors
50 /// No particular color---clear or default
52 /// The different text colors
69 // Needed interface colors
77 /// Background color of selected text
79 /// Text color in LaTeX mode
81 /// The color used for previews
84 /// Text color for notes
86 /// Background color of notes
88 /// Text color for comments
90 /// Background color of comments
92 /// Text color for greyedout inset
94 /// Background color of greyedout inset
98 /// Color for the depth bars in the margin
100 /// Color for marking foreign language words
103 /// Text color for command insets
105 /// Background color for command insets
107 /// Frame color for command insets
110 /// Special chars text color
113 /// Graphics inset background color
115 /// Math inset text color
117 /// Math inset background color
119 /// Macro math inset background color
121 /// Math inset frame color
126 /// caption frame color
129 /// collapsable insets text
131 /// collapsable insets frame
134 /// Inset marker background color
136 /// Inset marker frame color
139 /// Error box text color
143 /// Added space colour
145 /// Appendix marker color
153 /// Top and bottom line color
159 /// Bottom area color
164 // FIXME: why are the next four separate ??
165 /// Color used for top of boxes
167 /// Color used for bottom of boxes
169 /// Color used for left side of boxes
171 /// Color used for right side of boxes
173 /// Color used for bottom background
176 // Logical attributes
178 /// Color is inherited
180 /// For ignoring updates of a color
188 LColor(LColor const &);
192 void operator=(LColor const &);
194 /** set the given LyX color to the color defined by the X11 name given
195 * \returns true if successful.
197 bool setColor(LColor::color col, std::string const & x11name);
199 /** set the given LyX color to the color defined by the X11
200 * name given \returns true if successful. A new color entry
201 * is created if the color is unknown
203 bool setColor(std::string const & lyxname, std::string const & x11name);
205 /// Get the GUI name of \c color.
206 std::string const getGUIName(LColor::color c) const;
208 /// Get the X11 name of \c color.
209 std::string const getX11Name(LColor::color c) const;
211 /// Get the LaTeX name of \c color.
212 std::string const getLaTeXName(LColor::color c) const;
214 /// Get the LyX name of \c color.
215 std::string const getLyXName(LColor::color c) const;
217 /// \returns the LColor::color associated with the GUI name.
218 LColor::color getFromGUIName(std::string const & guiname) const;
219 /// \returns the LColor::color associated with the LyX name.
220 LColor::color getFromLyXName(std::string const & lyxname) const;
223 void addColor(LColor::color c, std::string const & lyxname) const;
227 boost::scoped_ptr<Pimpl> pimpl_;
231 /** \c LColor_color is a wrapper for LColor::color. It can be forward-declared and
232 * passed as a function argument without having to expose LColor.h.
237 /** The default constructor is nasty,
238 * but allows us to use LColor_color in STL containers.
240 LColor_color() : val_(static_cast<LColor::color>(-1)) {}
242 LColor_color(LColor::color val) : val_(val) {}
243 operator LColor::color() const{ return val_; }
247 /// the current color definitions
248 extern LColor lcolor;
249 /// the system color definitions
250 extern LColor system_lcolor;