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
15 #include "InsetMathNest.h"
22 class InsetMathColor : public InsetMathNest {
24 /// Create a color inset from LyX color number
25 InsetMathColor(Buffer * buf, bool oldstyle, ColorCode color = Color_none);
26 /// Create a color inset from LaTeX color name
27 InsetMathColor(Buffer * buf, bool oldstyle, docstring const & color);
29 void metrics(MetricsInfo & mi, Dimension & dim) const;
30 /// we write extra braces in any case...
31 /// FIXME Why? Are they necessary if oldstyle_ == false?
32 bool extraBraces() const { return true; }
34 void draw(PainterInfo & pi, int x, int y) const;
35 /// we need package color
36 void validate(LaTeXFeatures & features) const;
38 void write(WriteStream & os) const;
39 /// FIXME XHTML For now, we do nothing with color.
40 void mathmlize(MathStream &) const {}
41 /// FIXME XHTML For now, we do nothing with color.
42 void htmlize(HtmlStream &) const {}
44 /// write normalized content
45 void normalize(NormalStream & ns) const;
47 void infoize(odocstream & os) const;
49 InsetCode lyxCode() const { return MATH_COLOR_CODE; }
51 virtual Inset * clone() const;
52 /// width of '[' in current font
56 /// Our color. Only valid LaTeX colors are allowed.