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_BOXINSET_H
13 #define MATH_BOXINSET_H
15 #include "InsetMathNest.h"
22 /// Support for \\mbox
23 class InsetMathBox : public InsetMathNest {
26 explicit InsetMathBox(Buffer * buf, docstring const & name);
28 mode_type currentMode() const { return TEXT_MODE; }
30 void metrics(MetricsInfo & mi, Dimension & dim) const;
32 void draw(PainterInfo & pi, int x, int y) const;
34 void write(WriteStream & os) const;
36 void normalize(NormalStream & ns) const;
38 void mathmlize(MathStream & ms) const;
40 void infoize(odocstream & os) const;
42 void validate(LaTeXFeatures & features) const;
44 InsetCode lyxCode() const { return MATH_BOX_CODE; }
47 Inset * clone() const { return new InsetMathBox(*this); }
53 /// Non-AMS-style frame
54 class InsetMathFBox : public InsetMathNest {
57 InsetMathFBox(Buffer * buf);
59 mode_type currentMode() const { return TEXT_MODE; }
61 void metrics(MetricsInfo & mi, Dimension & dim) const;
63 void draw(PainterInfo & pi, int x, int y) const;
65 void write(WriteStream & os) const;
66 /// write normalized content
67 void normalize(NormalStream & ns) const;
69 void mathmlize(MathStream & ms) const;
71 void infoize(odocstream & os) const;
73 void validate(LaTeXFeatures & features) const;
76 Inset * clone() const { return new InsetMathFBox(*this); }
80 /// Extra nesting: \\makebox or \\framebox.
81 class InsetMathMakebox : public InsetMathNest {
84 InsetMathMakebox(Buffer * buf, bool framebox);
86 void metrics(MetricsInfo & mi, Dimension & dim) const;
88 void draw(PainterInfo & pi, int x, int y) const;
90 void write(WriteStream & os) const;
91 /// write normalized content
92 void normalize(NormalStream & ns) const;
94 void mathmlize(MathStream & ms) const;
96 mode_type currentMode() const { return TEXT_MODE; }
98 void infoize(odocstream & os) const;
100 void validate(LaTeXFeatures & features) const;
102 Inset * clone() const { return new InsetMathMakebox(*this); }
110 class InsetMathBoxed : public InsetMathNest {
113 InsetMathBoxed(Buffer * buf);
115 void validate(LaTeXFeatures & features) const;
117 void metrics(MetricsInfo & mi, Dimension & dim) const;
119 void draw(PainterInfo & pi, int x, int y) const;
121 void write(WriteStream & os) const;
123 void mathmlize(MathStream & ms) const;
124 /// write normalized content
125 void normalize(NormalStream & ns) const;
127 void infoize(odocstream & os) const;
129 Inset * clone() const { return new InsetMathBoxed(*this); }