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>
25 This is a stateless class.
27 It has one basic purposes:
28 To serve as a color-namespace container (the Color enum).
35 * A class holding color definitions and associated names for
36 * LaTeX, X11, the GUI, and LyX internally.
38 * A color can be one of the following kinds:
40 * - A real, predefined color, such as black, white, red or green.
41 * - A logical color, such as no color, inherit, math
45 // made copyable for same reasons as LyXRC was made copyable. See there for
49 /// Names of colors, including all logical colors
51 /// No particular color---clear or default
53 /// The different text colors
70 // Needed interface colors
78 /// Background color of selected text
80 /// Text color in LaTeX mode
82 /// The color used for previews
85 /// Text color for notes
87 /// Background color of notes
89 /// Text color for comments
91 /// Background color of comments
93 /// Text color for greyedout inset
95 /// Background color of greyedout inset
99 /// Color for the depth bars in the margin
101 /// Color for marking foreign language words
104 /// Text color for command insets
106 /// Background color for command insets
108 /// Frame color for command insets
111 /// Special chars text color
114 /// Graphics inset background color
116 /// Math inset text color
118 /// Math inset background color
120 /// Macro math inset background color
122 /// Math inset frame color
127 /// caption frame color
130 /// collapsable insets text
132 /// collapsable insets frame
135 /// Inset marker background color
137 /// Inset marker frame color
140 /// Error box text color
144 /// Added space colour
146 /// Appendix marker color
154 /// Top and bottom line color
160 /// Bottom area color
165 // FIXME: why are the next four separate ??
166 /// Color used for top of boxes
168 /// Color used for bottom of boxes
170 /// Color used for left side of boxes
172 /// Color used for right side of boxes
174 /// Color used for bottom background
177 // Logical attributes
179 /// Color is inherited
181 /// For ignoring updates of a color
189 LColor(LColor const &);
193 void operator=(LColor const &);
196 void LColor::fill(LColor::color c,
197 std::string const & lyxname,
198 std::string const & x11name = std::string(),
199 std::string const & latexname = std::string(),
200 std::string const & guiname = std::string());
202 /// set the given LyX color to the color defined by the X11 name given
203 void setColor(LColor::color col, std::string const & x11name);
204 /// set the given LyX color to the color defined by the X11 name given
205 bool setColor(std::string const & lyxname, std::string const & x11name);
207 /// Get GUI name of color
208 std::string const getGUIName(LColor::color c) const;
210 std::string const getGUIName(std::string const & s) const;
212 /// Get X11 name of color
213 std::string const getX11Name(LColor::color c) const;
215 std::string const getX11Name(std::string const & s) const;
217 /// Get LaTeX name of color
218 std::string const getLaTeXName(LColor::color c) const;
220 std::string const getLaTeXName(std::string const & s) const;
222 /// Get LyX name of color
223 std::string const getLyXName(LColor::color c) const;
224 /// (string-to-string version not needed as it is identity)
229 /// get the color from the GUI name
230 LColor::color getFromGUIName(std::string const & guiname) const;
231 /// get the color from the LyX name
232 LColor::color getFromLyXName(std::string const & lyxname) const;
237 boost::scoped_ptr<Pimpl> pimpl_;
241 /** \c LColor_color is a wrapper for LColor::color. It can be forward-declared and
242 * passed as a function argument without having to expose LColor.h.
247 /** The default constructor is nasty,
248 * but allows us to use LColor_color in STL containers.
250 LColor_color() : val_(static_cast<LColor::color>(-1)) {}
252 LColor_color(LColor::color val) : val_(val) {}
253 operator LColor::color() const{ return val_; }
257 /// the current color definitions
258 extern LColor lcolor;
259 /// the system color definitions
260 extern LColor system_lcolor;