]> git.lyx.org Git - lyx.git/blob - src/mathed/math_numberinset.C
minimal effort implementation of:
[lyx.git] / src / mathed / math_numberinset.C
1 /**
2  * \file math_numberinset.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 "math_numberinset.h"
14 #include "math_mathmlstream.h"
15 #include "math_streamstr.h"
16 #include "math_support.h"
17
18 using lyx::docstring;
19
20 using std::string;
21 using std::auto_ptr;
22
23
24 MathNumberInset::MathNumberInset(string const & s)
25         : str_(s)
26 {}
27
28
29 auto_ptr<InsetBase> MathNumberInset::doClone() const
30 {
31         return auto_ptr<InsetBase>(new MathNumberInset(*this));
32 }
33
34
35 void MathNumberInset::metrics(MetricsInfo & mi, Dimension & dim) const
36 {
37         mathed_string_dim(mi.base.font, str_, dim);
38 }
39
40
41 void MathNumberInset::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 MathNumberInset::normalize(NormalStream & os) const
49 {
50         os << "[number " << str_ << ']';
51 }
52
53
54 void MathNumberInset::maple(MapleStream & os) const
55 {
56         os << str_;
57 }
58
59
60 void MathNumberInset::octave(OctaveStream & os) const
61 {
62         os << str_;
63 }
64
65
66 void MathNumberInset::mathmlize(MathMLStream & os) const
67 {
68         os << "<mi> " << str_ << " </mi>";
69 }
70
71
72 void MathNumberInset::write(WriteStream & os) const
73 {
74         os << str_;
75 }