X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathColor.h;h=c09e14a117e5b02af1886123ced194694d1d5126;hb=89120ce72238077d08c52e4558d83f9d81e7d573;hp=68c0f47f588654b94c6f155305d3397b8fc53481;hpb=6c300f72a217722652dc27db9108e1050028979c;p=lyx.git diff --git a/src/mathed/InsetMathColor.h b/src/mathed/InsetMathColor.h index 68c0f47f58..c09e14a117 100644 --- a/src/mathed/InsetMathColor.h +++ b/src/mathed/InsetMathColor.h @@ -4,7 +4,7 @@ * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * - * \author André Pönitz + * \author André Pönitz * * Full author contact details are available in file CREDITS. */ @@ -12,8 +12,6 @@ #ifndef MATH_COLORINSET_H #define MATH_COLORINSET_H -#include "LColor.h" - #include "InsetMathNest.h" @@ -24,33 +22,41 @@ namespace lyx { class InsetMathColor : public InsetMathNest { public: /// Create a color inset from LyX color number - explicit InsetMathColor(bool oldstyle, - LColor_color const & color = LColor::none); + InsetMathColor(Buffer * buf, bool oldstyle, ColorCode color = Color_none); /// Create a color inset from LaTeX color name - explicit InsetMathColor(bool oldstyle, std::string const & color); + InsetMathColor(Buffer * buf, bool oldstyle, docstring const & color); /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + void metrics(MetricsInfo & mi, Dimension & dim) const override; /// we write extra braces in any case... /// FIXME Why? Are they necessary if oldstyle_ == false? - bool extraBraces() const { return true; } + bool extraBraces() const override { return true; } /// - void draw(PainterInfo & pi, int x, int y) const; + void draw(PainterInfo & pi, int x, int y) const override; /// we need package color - void validate(LaTeXFeatures & features) const; + void validate(LaTeXFeatures & features) const override; + /// we inherit the mode + mode_type currentMode() const override { return current_mode_; } + /// + void write(TeXMathStream & os) const override; + /// FIXME XHTML For now, we do nothing with color. + void mathmlize(MathMLStream &) const override {} + /// FIXME XHTML For now, we do nothing with color. + void htmlize(HtmlStream &) const override {} /// - void write(WriteStream & os) const; /// write normalized content - void normalize(NormalStream & ns) const; + void normalize(NormalStream & ns) const override; + /// + void infoize(odocstream & os) const override; /// - void infoize(std::ostream & os) const; + InsetCode lyxCode() const override { return MATH_COLOR_CODE; } private: - virtual std::auto_ptr doClone() const; - /// width of '[' in current font - mutable int w_; + Inset * clone() const override; /// bool oldstyle_; /// Our color. Only valid LaTeX colors are allowed. - std::string color_; + docstring color_; + /// the inherited mode + mutable mode_type current_mode_; };