]> git.lyx.org Git - lyx.git/blob - src/LColor.h
remove mention of lyxrc from the splash
[lyx.git] / src / LColor.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  *
5  *           LyX, The Document Processor
6  *
7  *          Copyright 1998-2001 The LyX Team
8  *
9  *======================================================*/
10
11 #ifndef LCOLOR_H
12 #define LCOLOR_H
13
14 #include "LString.h"
15
16 /**
17   This is a stateless class.
18
19   It has one basic purposes:
20   To serve as a color-namespace container (the Color enum).
21
22
23   */
24 /**
25  * \class LColor
26  *
27  * A class holding color definitions and associated names for
28  * LaTeX, X11, the GUI, and LyX internally.
29  *
30  * A color can be one of the following kinds:
31  *
32  * - A real, predefined color, such as black, white, red or green.
33  * - A logical color, such as no color, inherit, math
34  */
35
36 class LColor 
37 // made copyable for same reasons as LyXRC was made copyable. See there for
38 // explanation.
39 {
40 public:
41         /// Names of colors, including all logical colors
42         enum color {
43                 /// No particular color---clear or default
44                 none,
45                 /// The different text colors
46                 black,
47                 ///
48                 white,
49                 ///
50                 red,
51                 ///
52                 green,
53                 ///
54                 blue,
55                 ///
56                 cyan,
57                 ///
58                 magenta,
59                 ///
60                 yellow,
61
62                 // Needed interface colors
63
64                 /// Cursor color
65                 cursor,
66                 /// Background color
67                 background,
68                 /// Foreground color
69                 foreground,
70                 /// Background color of selected text
71                 selection,
72                 /// Text color in LaTeX mode
73                 latex,
74                 /// The color used for previews
75                 preview,
76
77                 /// Text color for notes
78                 note,
79                 /// Background color of notes
80                 notebg,
81
82
83                 /// Color for the depth bars in the margin
84                 depthbar,
85                 /// Color for marking foreign language words
86                 language,
87
88                 /// Text color for command insets
89                 command,
90                 /// Background color for command insets
91                 commandbg,
92                 /// Frame color for command insets
93                 commandframe,
94
95                 /// Special chars text color
96                 special,
97
98                 /// Graphics inset background color
99                 graphicsbg,
100                 /// Math inset text color
101                 math,
102                 /// Math inset background color
103                 mathbg,
104                 /// Macro math inset background color
105                 mathmacrobg,
106                 /// Math inset frame color
107                 mathframe,
108                 /// Math line color
109                 mathline,
110
111                 /// caption frame color
112                 captionframe,
113
114                 /// collapsable insets text
115                 collapsable,
116                 /// collapsable insets frame
117                 collapsableframe,
118
119                 /// Inset marker background color
120                 insetbg,
121                 /// Inset marker frame color
122                 insetframe,
123
124                 /// Error box text color
125                 error,
126                 /// EOL marker color
127                 eolmarker,
128                 /// Added space colour
129                 added_space,
130                 /// Appendix marker color
131                 appendix,
132                 /// changebar color
133                 changebar,
134                 /// strike-out color
135                 strikeout,
136                 /// added text color
137                 newtext,
138                 /// Top and bottom line color
139                 topline,
140                 /// Table line color
141                 tabularline,
142                 /// Table line color
143                 tabularonoffline,
144                 /// Bottom area color
145                 bottomarea,
146                 /// Page break color
147                 pagebreak,
148
149                 // FIXME: why are the next four separate ??
150                 /// Color used for top of boxes
151                 top,
152                 /// Color used for bottom of boxes
153                 bottom,
154                 /// Color used for left side of boxes
155                 left,
156                 /// Color used for right side of boxes
157                 right,
158                 /// Color used for bottom background
159                 buttonbg,
160
161                 // Logical attributes
162
163                 /// Color is inherited
164                 inherit,
165                 /// For ignoring updates of a color
166                 ignore
167         };
168
169         ///
170         LColor();
171         ///
172         LColor(LColor const &);
173         ///
174         ~LColor();
175         ///
176         void operator=(LColor const &);
177         /// set the given LyX color to the color defined by the X11 name given
178         void setColor(LColor::color col, string const & x11name);
179         /// set the given LyX color to the color defined by the X11 name given
180         bool setColor(string const & lyxname, string const & x11name);
181
182         /// Get GUI name of color
183         string const getGUIName(LColor::color c) const;
184
185         /// Get X11 name of color
186         string const getX11Name(LColor::color c) const;
187
188         /// Get LaTeX name of color
189         string const getLaTeXName(LColor::color c) const;
190
191         /// Get LyX name of color
192         string const getLyXName(LColor::color c) const;
193
194         /// get the color from the GUI name
195         LColor::color getFromGUIName(string const & guiname) const;
196         /// get the color from the LyX name
197         LColor::color getFromLyXName(string const & lyxname) const;
198 private:
199         ///
200         struct Pimpl;
201         ///
202         Pimpl * pimpl_;
203 };
204
205 /// the current color definitions
206 extern LColor lcolor;
207 /// the system color definitions
208 extern LColor system_lcolor;
209
210 #endif