]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathClass.cpp
typo
[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
15 #include "support/docstream.h"
16
17
18 namespace lyx {
19
20 InsetMathClass::InsetMathClass(Buffer * buf, MathClass mc)
21         : InsetMathNest(buf, 1), math_class_(mc)
22 {}
23
24
25 Inset * InsetMathClass::clone() const
26 {
27         return new InsetMathClass(*this);
28 }
29
30
31 Limits InsetMathClass::defaultLimits(bool display) const
32 {
33         if (allowsLimitsChange() && display)
34                 return LIMITS;
35         else
36                 return NO_LIMITS;
37 }
38
39
40 void InsetMathClass::metrics(MetricsInfo & mi, Dimension & dim) const
41 {
42         cell(0).metrics(mi, dim);
43 }
44
45
46 void InsetMathClass::draw(PainterInfo & pi, int x, int y) const
47 {
48         cell(0).draw(pi, x, y);
49 }
50
51
52 void InsetMathClass::write(TeXMathStream & os) const
53 {
54         InsetMathNest::write(os);
55         writeLimits(os);
56 }
57
58
59 docstring InsetMathClass::name() const
60 {
61         return class_to_string(math_class_);
62 }
63
64
65 void InsetMathClass::infoize(odocstream & os) const
66 {
67         os << name() << " ";
68 }
69
70
71 } // namespace lyx