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