]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathNumber.C
Fix command-line export
[lyx.git] / src / mathed / InsetMathNumber.C
1 /**
2  * \file InsetMathNumber.C
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 "MathMLStream.h"
15 #include "MathStream.h"
16 #include "MathSupport.h"
17
18 using lyx::docstring;
19
20 using std::string;
21 using std::auto_ptr;
22
23
24 InsetMathNumber::InsetMathNumber(string const & s)
25         : str_(s)
26 {}
27
28
29 auto_ptr<InsetBase> InsetMathNumber::doClone() const
30 {
31         return auto_ptr<InsetBase>(new InsetMathNumber(*this));
32 }
33
34
35 void InsetMathNumber::metrics(MetricsInfo & mi, Dimension & dim) const
36 {
37         mathed_string_dim(mi.base.font, str_, dim);
38 }
39
40
41 void InsetMathNumber::draw(PainterInfo & pi, int x, int y) const
42 {
43         docstring const dstr(str_.begin(), str_.end());
44         pi.draw(x, y, dstr);
45 }
46
47
48 void InsetMathNumber::normalize(NormalStream & os) const
49 {
50         os << "[number " << str_ << ']';
51 }
52
53
54 void InsetMathNumber::maple(MapleStream & os) const
55 {
56         os << str_;
57 }
58
59
60 void InsetMathNumber::mathematica(MathematicaStream & os) const
61 {
62         os << str_;
63 }
64
65
66 void InsetMathNumber::octave(OctaveStream & os) const
67 {
68         os << str_;
69 }
70
71
72 void InsetMathNumber::mathmlize(MathMLStream & os) const
73 {
74         os << "<mi> " << str_ << " </mi>";
75 }
76
77
78 void InsetMathNumber::write(WriteStream & os) const
79 {
80         os << str_;
81 }