]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathBox.h
Fix formatFPnumber with negative doubles.
[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
18 namespace lyx {
19
20 /// Support for \\mbox
21 class InsetMathBox : public InsetMathNest {
22 public:
23         ///
24         explicit InsetMathBox(Buffer * buf, docstring const & name);
25         ///
26         mode_type currentMode() const { return TEXT_MODE; }
27         ///
28         void metrics(MetricsInfo & mi, Dimension & dim) const;
29         ///
30         void draw(PainterInfo & pi, int x, int y) const;
31         ///
32         void write(WriteStream & os) const;
33         ///
34         void normalize(NormalStream & ns) const;
35         ///
36         void mathmlize(MathStream & ms) const;
37         ///
38         void htmlize(HtmlStream & 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 htmlize(HtmlStream & ms) const;
72         ///
73         void infoize(odocstream & os) const;
74         ///
75         void validate(LaTeXFeatures & features) const;
76 private:
77         ///
78         Inset * clone() const { return new InsetMathFBox(*this); }
79 };
80
81
82 /// Extra nesting: \\makebox or \\framebox.
83 class InsetMathMakebox : public InsetMathNest {
84 public:
85         ///
86         InsetMathMakebox(Buffer * buf, bool framebox);
87         ///
88         void metrics(MetricsInfo & mi, Dimension & dim) const;
89         ///
90         void draw(PainterInfo & pi, int x, int y) const;
91         ///
92         void write(WriteStream & os) const;
93         /// write normalized content
94         void normalize(NormalStream & ns) const;
95         ///
96         void mathmlize(MathStream & ms) const;
97         ///
98         void htmlize(HtmlStream & ms) const;
99         ///
100         mode_type currentMode() const { return TEXT_MODE; }
101         ///
102         void infoize(odocstream & os) const;
103         ///
104         void validate(LaTeXFeatures & features) const;
105 private:
106         Inset * clone() const { return new InsetMathMakebox(*this); }
107         ///
108         bool framebox_;
109 };
110
111
112
113 /// AMS-style frame
114 class InsetMathBoxed : public InsetMathNest {
115 public:
116         ///
117         InsetMathBoxed(Buffer * buf);
118         ///
119         void validate(LaTeXFeatures & features) const;
120         ///
121         void metrics(MetricsInfo & mi, Dimension & dim) const;
122         ///
123         void draw(PainterInfo & pi, int x, int y) const;
124         ///
125         void write(WriteStream & os) const;
126         ///
127         void mathmlize(MathStream & ms) const;
128         ///
129         void htmlize(HtmlStream & ms) const;
130         /// write normalized content
131         void normalize(NormalStream & ns) const;
132         ///
133         void infoize(odocstream & os) const;
134 private:
135         Inset * clone() const { return new InsetMathBoxed(*this); }
136 };
137
138
139 } // namespace lyx
140
141 #endif // MATH_MBOX