3 * \file InsetMathColor.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_COLORINSET_H
13 #define MATH_COLORINSET_H
17 #include "InsetMathNest.h"
24 class InsetMathColor : public InsetMathNest {
26 /// Create a color inset from LyX color number
27 explicit InsetMathColor(bool oldstyle,
28 Color_color const & color = Color::none);
29 /// Create a color inset from LaTeX color name
30 explicit InsetMathColor(bool oldstyle, docstring const & color);
32 bool metrics(MetricsInfo & mi, Dimension & dim) const;
33 /// we write extra braces in any case...
34 /// FIXME Why? Are they necessary if oldstyle_ == false?
35 bool extraBraces() const { return true; }
37 void draw(PainterInfo & pi, int x, int y) const;
38 /// we need package color
39 void validate(LaTeXFeatures & features) const;
41 void write(WriteStream & os) const;
42 /// write normalized content
43 void normalize(NormalStream & ns) const;
45 void infoize(odocstream & os) const;
47 virtual Inset * clone() const;
48 /// width of '[' in current font
52 /// Our color. Only valid LaTeX colors are allowed.