]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathNumber.cpp
Move several common types to support/types.h
[lyx.git] / src / mathed / InsetMathNumber.cpp
1 /**
2  * \file InsetMathNumber.cpp
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 "MathStream.h"
15 #include "MathSupport.h"
16
17 #include "MetricsInfo.h"
18
19 using namespace std;
20
21
22 namespace lyx {
23
24 InsetMathNumber::InsetMathNumber(docstring const & s)
25         : str_(s)
26 {}
27
28
29 Inset * InsetMathNumber::clone() const
30 {
31         return 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         pi.draw(x, y, str_);
44 }
45
46
47 void InsetMathNumber::normalize(NormalStream & os) const
48 {
49         os << "[number " << str_ << ']';
50 }
51
52
53 void InsetMathNumber::maple(MapleStream & os) const
54 {
55         os << str_;
56 }
57
58
59 void InsetMathNumber::mathematica(MathematicaStream & os) const
60 {
61         os << str_;
62 }
63
64
65 void InsetMathNumber::octave(OctaveStream & os) const
66 {
67         os << str_;
68 }
69
70
71 void InsetMathNumber::mathmlize(MathStream & ms) const
72 {
73         ms << "<" << from_ascii(ms.namespacedTag("mn")) << ">"
74            << str_
75            << "</" << from_ascii(ms.namespacedTag("mn")) << ">";
76 }
77
78
79 void InsetMathNumber::htmlize(HtmlStream & os) const
80 {
81         os << str_;
82 }
83
84
85 void InsetMathNumber::write(WriteStream & os) const
86 {
87         os << str_;
88 }
89
90
91 } // namespace lyx