]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathNumber.cpp
eb2e85bdc73de6618f4c1915b0b0a7257aefef52
[lyx.git] / src / mathed / InsetMathNumber.cpp
1 /**
2  * \file InsetMathNumber.cpp
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author André Pönitz
7  *
8  * Full author contact details are available in file CREDITS.
9  */
10
11 #include <config.h>
12
13 #include "InsetMathNumber.h"
14 #include "MathStream.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17
18 using namespace std;
19
20
21 namespace lyx {
22
23 InsetMathNumber::InsetMathNumber(docstring const & s)
24         : str_(s)
25 {}
26
27
28 Inset * InsetMathNumber::clone() const
29 {
30         return new InsetMathNumber(*this);
31 }
32
33
34 void InsetMathNumber::metrics(MetricsInfo & mi, Dimension & dim) const
35 {
36         mathed_string_dim(mi.base.font, str_, dim);
37 }
38
39
40 void InsetMathNumber::draw(PainterInfo & pi, int x, int y) const
41 {
42         pi.draw(x, y, str_);
43 }
44
45
46 void InsetMathNumber::normalize(NormalStream & os) const
47 {
48         os << "[number " << str_ << ']';
49 }
50
51
52 void InsetMathNumber::maple(MapleStream & os) const
53 {
54         os << str_;
55 }
56
57
58 void InsetMathNumber::mathematica(MathematicaStream & os) const
59 {
60         os << str_;
61 }
62
63
64 void InsetMathNumber::octave(OctaveStream & os) const
65 {
66         os << str_;
67 }
68
69
70 docstring InsetMathNumber::mathmlize(MathStream & os) const
71 {
72         os << "<mn> " << str_ << " </mn>";
73         return docstring();
74 }
75
76
77 void InsetMathNumber::write(WriteStream & os) const
78 {
79         os << str_;
80 }
81
82
83 } // namespace lyx