]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathNumber.C
Fix some unicode conversion problems, more work needed.
[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 using std::vector;
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         vector<char_type> n(str_.begin(), str_.end());
40         mathed_string_dim(mi.base.font, n, dim);
41 }
42
43
44 void InsetMathNumber::draw(PainterInfo & pi, int x, int y) const
45 {
46         // FIXME UNICODE
47         pi.draw(x, y, from_utf8(str_));
48 }
49
50
51 void InsetMathNumber::normalize(NormalStream & os) const
52 {
53         os << "[number " << str_ << ']';
54 }
55
56
57 void InsetMathNumber::maple(MapleStream & os) const
58 {
59         os << str_;
60 }
61
62
63 void InsetMathNumber::mathematica(MathematicaStream & os) const
64 {
65         os << str_;
66 }
67
68
69 void InsetMathNumber::octave(OctaveStream & os) const
70 {
71         os << str_;
72 }
73
74
75 void InsetMathNumber::mathmlize(MathMLStream & os) const
76 {
77         os << "<mi> " << str_ << " </mi>";
78 }
79
80
81 void InsetMathNumber::write(WriteStream & os) const
82 {
83         os << str_;
84 }
85
86
87 } // namespace lyx