2 * \file InsetMathExInt.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "InsetMathExInt.h"
15 #include "MathStream.h"
16 #include "MathStream.h"
17 #include "InsetMathSymbol.h"
19 #include "support/debug.h"
20 #include "support/docstring.h"
25 InsetMathExInt::InsetMathExInt(Buffer * buf, docstring const & name)
26 : InsetMathNest(buf, 4), symbol_(name)
35 Inset * InsetMathExInt::clone() const
37 return new InsetMathExInt(*this);
41 void InsetMathExInt::symbol(docstring const & symbol)
47 bool InsetMathExInt::hasScripts() const
49 // take empty upper bound as "no scripts"
50 return !cell(3).empty();
55 void InsetMathExInt::normalize(NormalStream & os) const
57 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
58 << cell(2) << ' ' << cell(3) << ']';
62 void InsetMathExInt::metrics(MetricsInfo &, Dimension &) const
64 LYXERR0("should not happen");
68 void InsetMathExInt::draw(PainterInfo &, int, int) const
70 LYXERR0("should not happen");
74 void InsetMathExInt::maple(MapleStream & os) const
83 os << '=' << cell(2) << ".." << cell(3);
88 void InsetMathExInt::maxima(MaximaStream & os) const
100 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
102 os << cell(1) << ')';
105 void InsetMathExInt::mathematica(MathematicaStream & os) const
107 if (symbol_ == "int")
109 else if (symbol_ == "sum")
112 os << symbol_ << '[';
115 os << cell(0) << ',';
119 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
121 os << cell(1) << ']';
125 void InsetMathExInt::mathmlize(MathStream & os) const
127 // At the moment, we are not extracting sums and the like for MathML.
128 // If we should decide to do so later, then we'll need to re-merge
129 // r32566 and r32568.
130 // So right now this only handles integrals.
131 InsetMathSymbol sym(symbol_);
132 bool const lower = !cell(2).empty();
133 bool const upper = !cell(3).empty();
135 os << MTag("msubsup");
144 os << MTag("mrow") << cell(2) << ETag("mrow");
146 os << MTag("mrow") << cell(3) << ETag("mrow");
148 os << ETag("msubsup");
153 os << cell(0) << "<mo> ⁢ </mo>"
154 << MTag("mrow") << "<mo> ⅆ </mo>"
155 << cell(1) << ETag("mrow");
159 void InsetMathExInt::write(WriteStream &) const
161 LYXERR0("should not happen");