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"
20 /// Support for \\mbox
21 class InsetMathBox : public InsetMathNest {
24 explicit InsetMathBox(Buffer * buf, docstring const & name);
26 mode_type currentMode() const { return TEXT_MODE; }
28 void metrics(MetricsInfo & mi, Dimension & dim) const;
30 void draw(PainterInfo & pi, int x, int y) const;
32 void write(WriteStream & os) const;
34 void normalize(NormalStream & ns) const;
36 void mathmlize(MathStream & ms) const;
38 void htmlize(HtmlStream & 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 explicit InsetMathFBox(Buffer * buf);
59 mode_type currentMode() const { return TEXT_MODE; }
61 marker_type marker(BufferView const *) const { return NO_MARKER; }
63 void metrics(MetricsInfo & mi, Dimension & dim) const;
65 void draw(PainterInfo & pi, int x, int y) const;
67 void write(WriteStream & os) const;
68 /// write normalized content
69 void normalize(NormalStream & ns) const;
71 void mathmlize(MathStream & ms) const;
73 void htmlize(HtmlStream & ms) const;
75 void infoize(odocstream & os) const;
77 void validate(LaTeXFeatures & features) const;
80 Inset * clone() const { return new InsetMathFBox(*this); }
84 /// Extra nesting: \\makebox or \\framebox.
85 class InsetMathMakebox : public InsetMathNest {
88 InsetMathMakebox(Buffer * buf, bool framebox);
90 void metrics(MetricsInfo & mi, Dimension & dim) const;
92 void draw(PainterInfo & pi, int x, int y) const;
94 void write(WriteStream & os) const;
95 /// write normalized content
96 void normalize(NormalStream & ns) const;
98 void mathmlize(MathStream & ms) const;
100 void htmlize(HtmlStream & ms) const;
102 mode_type currentMode() const { return TEXT_MODE; }
104 void infoize(odocstream & os) const;
106 void validate(LaTeXFeatures & features) const;
108 Inset * clone() const { return new InsetMathMakebox(*this); }
116 class InsetMathBoxed : public InsetMathNest {
119 explicit InsetMathBoxed(Buffer * buf);
121 marker_type marker(BufferView const *) const { return NO_MARKER; }
123 void validate(LaTeXFeatures & features) const;
125 void metrics(MetricsInfo & mi, Dimension & dim) const;
127 void draw(PainterInfo & pi, int x, int y) const;
129 void write(WriteStream & os) const;
131 void mathmlize(MathStream & ms) const;
133 void htmlize(HtmlStream & ms) const;
134 /// write normalized content
135 void normalize(NormalStream & ns) const;
137 void infoize(odocstream & os) const;
139 Inset * clone() const { return new InsetMathBoxed(*this); }