]> git.lyx.org Git - lyx.git/blob - src/LColor.h
NEW_INSETS changes, + some small things in insettabular.C
[lyx.git] / src / LColor.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *          Copyright 1998-2000 The LyX Team
8  *
9  *======================================================*/
10
11 #ifndef LCOLOR_H
12 #define LCOLOR_H
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 #include <map>
19
20 #include "LString.h"
21
22 /**
23   This is a stateless class. 
24
25   It has one basic purposes:
26   To serve as a color-namespace container (the Color enum).
27   
28   A color can be one of the following kinds:
29
30   - A real, predefined color, such as black, white, red or green.
31   - A logical color, such as no color, inherit, math
32
33   */
34
35 class LColor {
36 public:
37         /// Names of colors, including all logical colors
38         enum color {
39                 /// No particular color---clear or default
40                 none,
41                 /// The different text colors
42                 black,
43                 ///
44                 white,
45                 ///
46                 red,
47                 ///
48                 green,
49                 ///
50                 blue,
51                 ///
52                 cyan,
53                 ///
54                 magenta,
55                 ///
56                 yellow,
57
58                 /// Needed interface colors
59
60                 /// Background color
61                 background,
62                 /// Foreground color
63                 foreground,
64                 /// Background color of selected text
65                 selection,
66                 /// Text color in LaTeX mode
67                 latex,
68                 /// Titles color of floats
69                 floats,
70
71                 /// Text color for notes
72                 note,
73                 /// Background color of notes
74                 notebg,
75                 /// Frame color for notes
76                 noteframe,
77
78
79                 /// Color for the depth bars in the margin
80                 depthbar,
81                 /// Color for marking foreign language words
82                 language,
83
84                 /// Text color for command insets
85                 command,
86                 /// Background color for command insets
87                 commandbg,
88                 /// Frame color for command insets
89                 commandframe,
90
91                 /// Text color for accents we can't handle nicely
92                 accent,
93                 ///
94                 accentbg,
95                 ///
96                 accentframe,
97
98                 /// Minipage line color
99                 minipageline,
100
101                 /// Special chars text color
102                 special,
103
104                 /// Math inset text color
105                 math,
106                 /// Math inset background color
107                 mathbg,
108                 /// Math inset frame color
109                 mathframe,
110                 /// Math cursor color
111                 mathcursor,
112                 /// Math line color
113                 mathline,
114
115                 /// Footnote marker text
116                 footnote,
117                 /// Footnote marker background color
118                 footnotebg,
119                 /// Footnote line color
120                 footnoteframe,
121
122                 /// ERT marker text
123                 ert,
124                 
125                 /// Text color for inset marker
126                 inset,
127                 /// Inset marker background color
128                 insetbg,
129                 /// Inset marker frame color
130                 insetframe,
131
132                 /// Error box text color
133                 error,
134                 /// EOL marker color
135                 eolmarker,
136                 /// Appendix line color
137                 appendixline,
138                 /// VFill line color
139                 vfillline,
140                 /// Top and bottom line color
141                 topline,
142                 /// Table line color
143                 tableline,
144                 /// Table line color
145                 tabularline,
146                 /// Table line color
147                 tabularonoffline,
148                 /// Bottom area color
149                 bottomarea,
150                 /// Page break color
151                 pagebreak,
152
153                 /// Color used for top of boxes
154                 top,
155                 /// Color used for bottom of boxes
156                 bottom,
157                 /// Color used for left side of boxes
158                 left,
159                 /// Color used for right side of boxes
160                 right,
161                 /// Color used for bottom background
162                 buttonbg,
163
164                 /// Logical attributes
165
166                 /// Color is inherited
167                 inherit,
168                 /// For ignoring updates of a color
169                 ignore
170         };
171
172         ///
173         LColor();
174         ///
175         void setColor(LColor::color col, string const & x11name);
176         ///
177         bool setColor(string const & lyxname, string const & x11name);
178         /// Get GUI name of color
179         string getGUIName(LColor::color c) const;
180
181         /// Get X11 name of color
182         string getX11Name(LColor::color c) const;
183
184         /// Get LaTeX name of color
185         string getLaTeXName(LColor::color c) const;
186
187         /// Get LyX name of color
188         string getLyXName(LColor::color c) const;
189         ///
190         LColor::color getFromGUIName(string const & guiname) const;
191         ///
192         LColor::color getFromLyXName(string const & lyxname) const;
193 private:
194         ///
195         struct information {
196                 string guiname;
197                 string latexname;
198                 string x11name;
199                 string lyxname;
200         };
201
202         ///
203         void fill(LColor::color col, string const & gui,
204                   string const & latex, string const & x11,
205                   string const & lyx);
206
207         ///
208         typedef std::map<LColor::color, information> InfoTab;
209
210         InfoTab infotab;
211 };
212
213 extern LColor lcolor;
214
215 #endif