]> git.lyx.org Git - lyx.git/blob - src/mathed/math_numberinset.C
some (yet unfinished) up/down work
[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 std::string;
19 using std::auto_ptr;
20
21
22 MathNumberInset::MathNumberInset(string const & s)
23         : str_(s)
24 {}
25
26
27 auto_ptr<InsetBase> MathNumberInset::doClone() const
28 {
29         return auto_ptr<InsetBase>(new MathNumberInset(*this));
30 }
31
32
33 void MathNumberInset::metrics(MetricsInfo & mi, Dimension & dim) const
34 {
35         mathed_string_dim(mi.base.font, str_, dim);
36 }
37
38
39 void MathNumberInset::draw(PainterInfo & pi, int x, int y) const
40 {
41         pi.draw(x, y, str_);
42 }
43
44
45 void MathNumberInset::normalize(NormalStream & os) const
46 {
47         os << "[number " << str_ << ']';
48 }
49
50
51 void MathNumberInset::maple(MapleStream & os) const
52 {
53         os << str_;
54 }
55
56
57 void MathNumberInset::octave(OctaveStream & os) const
58 {
59         os << str_;
60 }
61
62
63 void MathNumberInset::mathmlize(MathMLStream & os) const
64 {
65         os << "<mi> " << str_ << " </mi>";
66 }
67
68
69 void MathNumberInset::write(WriteStream & os) const
70 {
71         os << str_;
72 }