2 * \file math_exintinset.C
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 "math_exintinset.h"
14 #include "math_data.h"
15 #include "math_mathmlstream.h"
16 #include "math_streamstr.h"
17 #include "math_symbolinset.h"
25 MathExIntInset::MathExIntInset(string const & name)
26 : MathNestInset(4), symbol_(name)
35 auto_ptr<InsetBase> MathExIntInset::clone() const
37 return auto_ptr<InsetBase>(new MathExIntInset(*this));
41 void MathExIntInset::symbol(string const & symbol)
47 bool MathExIntInset::hasScripts() const
49 // take empty upper bound as "no scripts"
50 return !cell(3).empty();
55 void MathExIntInset::normalize(NormalStream & os) const
57 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
58 << cell(2) << ' ' << cell(3) << ']';
62 void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
64 lyxerr << "should not happen" << endl;
68 void MathExIntInset::draw(PainterInfo &, int, int) const
70 lyxerr << "should not happen" << endl;
74 void MathExIntInset::maple(MapleStream & os) const
83 os << '=' << cell(2) << ".." << cell(3);
88 void MathExIntInset::maxima(MaximaStream & os) const
90 if ( symbol_ == "int" )
100 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
102 os << cell(1) << ')';
105 void MathExIntInset::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 MathExIntInset::mathmlize(MathMLStream & os) const
127 boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
129 // mathmlize(sym, os);
132 os << cell(0) << "<mo> ⁢ </mo>"
133 << MTag("mrow") << "<mo> ⅆ </mo>"
134 << cell(1) << ETag("mrow");
138 void MathExIntInset::write(WriteStream &) const
140 lyxerr << "should not happen" << endl;