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>
29 * This is a stateless class.
31 * It has one basic purposes:
32 * To serve as a color-namespace container (the Color enum).
37 * A class holding color definitions and associated names for
38 * LaTeX, X11, the GUI, and LyX internally.
40 * A color can be one of the following kinds:
42 * - A real, predefined color, such as black, white, red or green.
43 * - A logical color, such as no color, inherit, math
47 // made copyable for same reasons as LyXRC was made copyable. See there for
51 /// Names of colors, including all logical colors
53 /// No particular color---clear or default
55 /// The different text colors
72 // Needed interface colors
80 /// Background color of selected text
82 /// Text color in LaTeX mode
84 /// The color used for previews
87 /// Text color for notes
89 /// Background color of notes
91 /// Text color for comments
93 /// Background color of comments
95 /// Text color for greyedout inset
97 /// Background color of greyedout inset
99 /// Shaded box background
102 /// Color for the depth bars in the margin
104 /// Color for marking foreign language words
107 /// Text color for command insets
109 /// Background color for command insets
111 /// Frame color for command insets
114 /// Special chars text color
117 /// Graphics inset background color
119 /// Math inset text color
121 /// Math inset background color
123 /// Macro math inset background color
125 /// Math inset frame color
130 /// caption frame color
133 /// collapsable insets text
135 /// collapsable insets frame
138 /// Inset marker background color
140 /// Inset marker frame color
143 /// Error box text color
147 /// Added space colour
149 /// Appendix marker color
157 /// Top and bottom line color
163 /// Bottom area color
168 // FIXME: why are the next four separate ??
169 /// Color used for top of boxes
171 /// Color used for bottom of boxes
173 /// Color used for left side of boxes
175 /// Color used for right side of boxes
177 /// Color used for bottom background
180 // Logical attributes
182 /// Color is inherited
184 /// For ignoring updates of a color
192 LColor(LColor const &);
196 LColor & operator=(LColor);
198 /** set the given LyX color to the color defined by the X11 name given
199 * \returns true if successful.
201 bool setColor(LColor::color col, std::string const & x11name);
203 /** set the given LyX color to the color defined by the X11
204 * name given \returns true if successful. A new color entry
205 * is created if the color is unknown
207 bool setColor(std::string const & lyxname, std::string const & x11name);
209 /// Get the GUI name of \c color.
210 std::string const getGUIName(LColor::color c) const;
212 /// Get the X11 name of \c color.
213 std::string const getX11Name(LColor::color c) const;
215 /// Get the LaTeX name of \c color.
216 std::string const getLaTeXName(LColor::color c) const;
218 /// Get the LyX name of \c color.
219 std::string const getLyXName(LColor::color c) const;
221 /// \returns the LColor::color associated with the GUI name.
222 LColor::color getFromGUIName(std::string const & guiname) const;
223 /// \returns the LColor::color associated with the LyX name.
224 LColor::color getFromLyXName(std::string const & lyxname) const;
225 /// \returns the LColor::color associated with the LaTeX name.
226 LColor::color getFromLaTeXName(std::string const & latexname) const;
229 void addColor(LColor::color c, std::string const & lyxname) const;
233 boost::scoped_ptr<Pimpl> pimpl_;
237 /** \c LColor_color is a wrapper for LColor::color. It can be forward-declared and
238 * passed as a function argument without having to expose LColor.h.
243 /** The default constructor is nasty,
244 * but allows us to use LColor_color in STL containers.
246 LColor_color() : val_(static_cast<LColor::color>(-1)) {}
248 LColor_color(LColor::color val) : val_(val) {}
249 operator LColor::color() const{ return val_; }
253 /// the current color definitions
254 extern LColor lcolor;
255 /// the system color definitions
256 extern LColor system_lcolor;