]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathClass.cpp
Fix functions that used functions but did not defined it
[lyx.git] / src / mathed / InsetMathClass.cpp
1 /**
2  * \file InsetMathClass.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 "InsetMathClass.h"
14 #include "MathStream.h"
15
16 #include "support/docstream.h"
17
18
19 namespace lyx {
20
21 InsetMathClass::InsetMathClass(Buffer * buf, MathClass mc)
22         : InsetMathNest(buf, 1), math_class_(mc)
23 {}
24
25
26 Inset * InsetMathClass::clone() const
27 {
28         return new InsetMathClass(*this);
29 }
30
31
32 Limits InsetMathClass::defaultLimits(bool display) const
33 {
34         if (allowsLimitsChange() && display)
35                 return LIMITS;
36         else
37                 return NO_LIMITS;
38 }
39
40
41 void InsetMathClass::metrics(MetricsInfo & mi, Dimension & dim) const
42 {
43         cell(0).metrics(mi, dim);
44 }
45
46
47 void InsetMathClass::draw(PainterInfo & pi, int x, int y) const
48 {
49         cell(0).draw(pi, x, y);
50 }
51
52
53 void InsetMathClass::write(TeXMathStream & os) const
54 {
55         InsetMathNest::write(os);
56         writeLimits(os);
57 }
58
59
60 void InsetMathClass::mathmlize(MathMLStream & ms) const
61 {
62         // Skip the \mathXXX macro, the MathML processor is supposed to handle
63         // spacing down the line.
64         for (size_t i = 0; i < nargs(); ++i) {
65                 ms << cell(i);
66         }
67 }
68
69
70 docstring InsetMathClass::name() const
71 {
72         return class_to_string(math_class_);
73 }
74
75
76 void InsetMathClass::infoize(odocstream & os) const
77 {
78         os << name() << " ";
79 }
80
81
82 } // namespace lyx