]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBox.h
Whitespace.
[lyx.git] / src / mathed / InsetMathBox.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathBox.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_BOXINSET_H
13 #define MATH_BOXINSET_H
14
15 #include "InsetMathNest.h"
16
17 #include <string>
18
19
20 namespace lyx {
21
22 /// Support for \\mbox
23 class InsetMathBox : public InsetMathNest {
24 public:
25         ///
26         explicit InsetMathBox(Buffer * buf, docstring const & name);
27         ///
28         mode_type currentMode() const { return TEXT_MODE; }
29         ///
30         void metrics(MetricsInfo & mi, Dimension & dim) const;
31         ///
32         void draw(PainterInfo & pi, int x, int y) const;
33         ///
34         void write(WriteStream & os) const;
35         ///
36         void normalize(NormalStream & ns) const;
37         ///
38         void mathmlize(MathStream & ms) const;
39         ///
40         void infoize(odocstream & os) const;
41         ///
42         void validate(LaTeXFeatures & features) const;
43         ///
44         InsetCode lyxCode() const { return MATH_BOX_CODE; }
45
46 private:
47         Inset * clone() const { return new InsetMathBox(*this); }
48         ///
49         docstring name_;
50 };
51
52
53 /// Non-AMS-style frame
54 class InsetMathFBox : public InsetMathNest {
55 public:
56         ///
57         InsetMathFBox(Buffer * buf);
58         ///
59         mode_type currentMode() const { return TEXT_MODE; }
60         ///
61         void metrics(MetricsInfo & mi, Dimension & dim) const;
62         ///
63         void draw(PainterInfo & pi, int x, int y) const;
64         ///
65         void write(WriteStream & os) const;
66         /// write normalized content
67         void normalize(NormalStream & ns) const;
68         ///
69         void mathmlize(MathStream & ms) const;
70         ///
71         void infoize(odocstream & os) const;
72         ///
73         void validate(LaTeXFeatures & features) const;
74 private:
75         ///
76         Inset * clone() const { return new InsetMathFBox(*this); }
77 };
78
79
80 /// Extra nesting: \\makebox or \\framebox.
81 class InsetMathMakebox : public InsetMathNest {
82 public:
83         ///
84         InsetMathMakebox(Buffer * buf, bool framebox);
85         ///
86         void metrics(MetricsInfo & mi, Dimension & dim) const;
87         ///
88         void draw(PainterInfo & pi, int x, int y) const;
89         ///
90         void write(WriteStream & os) const;
91         /// write normalized content
92         void normalize(NormalStream & ns) const;
93         ///
94         void mathmlize(MathStream & ms) const;
95         ///
96         mode_type currentMode() const { return TEXT_MODE; }
97         ///
98         void infoize(odocstream & os) const;
99         ///
100         void validate(LaTeXFeatures & features) const;
101 private:
102         Inset * clone() const { return new InsetMathMakebox(*this); }
103         ///
104         bool framebox_;
105 };
106
107
108
109 /// AMS-style frame
110 class InsetMathBoxed : public InsetMathNest {
111 public:
112         ///
113         InsetMathBoxed(Buffer * buf);
114         ///
115         void validate(LaTeXFeatures & features) const;
116         ///
117         void metrics(MetricsInfo & mi, Dimension & dim) const;
118         ///
119         void draw(PainterInfo & pi, int x, int y) const;
120         ///
121         void write(WriteStream & os) const;
122         ///
123         void mathmlize(MathStream & ms) const;
124         /// write normalized content
125         void normalize(NormalStream & ns) const;
126         ///
127         void infoize(odocstream & os) const;
128 private:
129         Inset * clone() const { return new InsetMathBoxed(*this); }
130 };
131
132
133 } // namespace lyx
134
135 #endif // MATH_MBOX