]> git.lyx.org Git - features.git/blob - src/mathed/InsetMathBox.h
4ef299401d9b6df2dd4931e6ab8384b8f0cc71fc
[features.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 private:
73         ///
74         Inset * clone() const { return new InsetMathFBox(*this); }
75 };
76
77
78 /// Extra nesting: \\makebox or \\framebox.
79 class InsetMathMakebox : public InsetMathNest {
80 public:
81         ///
82         InsetMathMakebox(Buffer * buf, bool framebox);
83         ///
84         void metrics(MetricsInfo & mi, Dimension & dim) const;
85         ///
86         void draw(PainterInfo & pi, int x, int y) const;
87         ///
88         void write(WriteStream & os) const;
89         /// write normalized content
90         void normalize(NormalStream & ns) const;
91         ///
92         //void mathmlize(MathStream & ms) const;
93         ///
94         mode_type currentMode() const { return TEXT_MODE; }
95         ///
96         void infoize(odocstream & os) const;
97 private:
98         Inset * clone() const { return new InsetMathMakebox(*this); }
99         ///
100         bool framebox_;
101 };
102
103
104
105 /// AMS-style frame
106 class InsetMathBoxed : public InsetMathNest {
107 public:
108         ///
109         InsetMathBoxed(Buffer * buf);
110         ///
111         void validate(LaTeXFeatures & features) const;
112         ///
113         void metrics(MetricsInfo & mi, Dimension & dim) const;
114         ///
115         void draw(PainterInfo & pi, int x, int y) const;
116         ///
117         void write(WriteStream & os) const;
118         ///
119         //void mathmlize(MathStream & ms) const;
120         /// write normalized content
121         void normalize(NormalStream & ns) const;
122         ///
123         void infoize(odocstream & os) const;
124 private:
125         Inset * clone() const { return new InsetMathBoxed(*this); }
126 };
127
128
129 } // namespace lyx
130
131 #endif // MATH_MBOX