X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathBox.h;h=898376583648135bb344f9f03d74b9b8464482a8;hb=d9082639080b9de993742bd352f92e5183058cf5;hp=b68280aaacf7ae60e3d9d2a8e5f8f16f9228d5bf;hpb=a085842f14c47e3c222ed2d887595d6cc6a61dd6;p=lyx.git diff --git a/src/mathed/InsetMathBox.h b/src/mathed/InsetMathBox.h index b68280aaac..8983765836 100644 --- a/src/mathed/InsetMathBox.h +++ b/src/mathed/InsetMathBox.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. */ @@ -14,8 +14,6 @@ #include "InsetMathNest.h" -#include - namespace lyx { @@ -23,22 +21,30 @@ namespace lyx { class InsetMathBox : public InsetMathNest { public: /// - explicit InsetMathBox(docstring const & name); + explicit InsetMathBox(Buffer * buf, docstring const & name); + /// + mode_type currentMode() const override { return TEXT_MODE; } + /// + void metrics(MetricsInfo & mi, Dimension & dim) const override; /// - mode_type currentMode() const { return TEXT_MODE; } + void draw(PainterInfo & pi, int x, int y) const override; /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + void write(TeXMathStream & os) const override; /// - void draw(PainterInfo & pi, int x, int y) const; + void normalize(NormalStream & ns) const override; /// - void write(WriteStream & os) const; + void mathmlize(MathMLStream & ms) const override; /// - void normalize(NormalStream & ns) const; + void htmlize(HtmlStream & ms) const override; /// - void infoize(odocstream & os) const; + void infoize(odocstream & os) const override; + /// + void validate(LaTeXFeatures & features) const override; + /// + InsetCode lyxCode() const override { return MATH_BOX_CODE; } private: - Inset * clone() const { return new InsetMathBox(*this); } + Inset * clone() const override { return new InsetMathBox(*this); } /// docstring name_; }; @@ -48,67 +54,60 @@ private: class InsetMathFBox : public InsetMathNest { public: /// - InsetMathFBox(); - /// - mode_type currentMode() const { return TEXT_MODE; } + explicit InsetMathFBox(Buffer * buf); /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + mode_type currentMode() const override { return TEXT_MODE; } /// - void draw(PainterInfo & pi, int x, int y) const; + marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; } /// - void write(WriteStream & os) const; - /// write normalized content - void normalize(NormalStream & ns) const; + void metrics(MetricsInfo & mi, Dimension & dim) const override; /// - void infoize(odocstream & os) const; -private: + void draw(PainterInfo & pi, int x, int y) const override; /// - Inset * clone() const { return new InsetMathFBox(*this); } -}; - - -/// Extra nesting -class InsetMathFrameBox : public InsetMathNest { -public: - /// - InsetMathFrameBox(); + void write(TeXMathStream & os) const override; + /// write normalized content + void normalize(NormalStream & ns) const override; /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + void mathmlize(MathMLStream & ms) const override; /// - void draw(PainterInfo & pi, int x, int y) const; + void htmlize(HtmlStream & ms) const override; /// - void write(WriteStream & os) const; - /// write normalized content - void normalize(NormalStream & ns) const; + void infoize(odocstream & os) const override; /// - mode_type currentMode() const { return TEXT_MODE; } + void validate(LaTeXFeatures & features) const override; private: - Inset * clone() const { return new InsetMathFrameBox(*this); } + /// + Inset * clone() const override { return new InsetMathFBox(*this); } }; -/// Extra nesting: \\makebox. -// consolidate with InsetMathFrameBox? +/// Extra nesting: \\makebox or \\framebox. class InsetMathMakebox : public InsetMathNest { public: /// - InsetMathMakebox(); + InsetMathMakebox(Buffer * buf, bool framebox); /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + void metrics(MetricsInfo & mi, Dimension & dim) const override; /// - void draw(PainterInfo & pi, int x, int y) const; + void draw(PainterInfo & pi, int x, int y) const override; /// - void write(WriteStream & os) const; + void write(TeXMathStream & os) const override; /// write normalized content - void normalize(NormalStream & ns) const; + void normalize(NormalStream & ns) const override; + /// + void mathmlize(MathMLStream & ms) const override; + /// + void htmlize(HtmlStream & ms) const override; /// - mode_type currentMode() const { return TEXT_MODE; } + mode_type currentMode() const override { return TEXT_MODE; } /// - void infoize(odocstream & os) const; + void infoize(odocstream & os) const override; + /// + void validate(LaTeXFeatures & features) const override; private: - Inset * clone() const { return new InsetMathMakebox(*this); } - /// width of '[' in current font - mutable int w_; + Inset * clone() const override { return new InsetMathMakebox(*this); } + /// + bool framebox_; }; @@ -117,21 +116,27 @@ private: class InsetMathBoxed : public InsetMathNest { public: /// - InsetMathBoxed(); + explicit InsetMathBoxed(Buffer * buf); + /// + marker_type marker(BufferView const *) const override { return marker_type::NO_MARKER; } + /// + void validate(LaTeXFeatures & features) const override; + /// + void metrics(MetricsInfo & mi, Dimension & dim) const override; /// - void validate(LaTeXFeatures & features) const; + void draw(PainterInfo & pi, int x, int y) const override; /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + void write(TeXMathStream & os) const override; /// - void draw(PainterInfo & pi, int x, int y) const; + void mathmlize(MathMLStream & ms) const override; /// - void write(WriteStream & os) const; + void htmlize(HtmlStream & ms) const override; /// write normalized content - void normalize(NormalStream & ns) const; + void normalize(NormalStream & ns) const override; /// - void infoize(odocstream & os) const; + void infoize(odocstream & os) const override; private: - Inset * clone() const { return new InsetMathBoxed(*this); } + Inset * clone() const override { return new InsetMathBoxed(*this); } };