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"
20 #include <boost/scoped_ptr.hpp>
28 MathExIntInset::MathExIntInset(string const & name)
29 : MathNestInset(4), symbol_(name)
38 auto_ptr<InsetBase> MathExIntInset::doClone() const
40 return auto_ptr<InsetBase>(new MathExIntInset(*this));
44 void MathExIntInset::symbol(string const & symbol)
50 bool MathExIntInset::hasScripts() const
52 // take empty upper bound as "no scripts"
53 return !cell(3).empty();
58 void MathExIntInset::normalize(NormalStream & os) const
60 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
61 << cell(2) << ' ' << cell(3) << ']';
65 void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
67 lyxerr << "should not happen" << endl;
71 void MathExIntInset::draw(PainterInfo &, int, int) const
73 lyxerr << "should not happen" << endl;
77 void MathExIntInset::maple(MapleStream & os) const
86 os << '=' << cell(2) << ".." << cell(3);
91 void MathExIntInset::maxima(MaximaStream & os) const
93 if ( symbol_ == "int" )
103 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
105 os << cell(1) << ')';
108 void MathExIntInset::mathematica(MathematicaStream & os) const
110 if ( symbol_ == "int" )
112 else if (symbol_ == "sum")
115 os << symbol_ << '[';
118 os << cell(0) << ',';
122 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
124 os << cell(1) << ']';
128 void MathExIntInset::mathmlize(MathMLStream & os) const
130 boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
132 // mathmlize(sym, os);
135 os << cell(0) << "<mo> ⁢ </mo>"
136 << MTag("mrow") << "<mo> ⅆ </mo>"
137 << cell(1) << ETag("mrow");
141 void MathExIntInset::write(WriteStream &) const
143 lyxerr << "should not happen" << endl;