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"
19 #include <boost/scoped_ptr.hpp>
26 MathExIntInset::MathExIntInset(string const & name)
27 : MathNestInset(4), symbol_(name)
36 auto_ptr<InsetBase> MathExIntInset::clone() const
38 return auto_ptr<InsetBase>(new MathExIntInset(*this));
42 void MathExIntInset::symbol(string const & symbol)
48 bool MathExIntInset::hasScripts() const
50 // take empty upper bound as "no scripts"
51 return !cell(3).empty();
56 void MathExIntInset::normalize(NormalStream & os) const
58 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
59 << cell(2) << ' ' << cell(3) << ']';
63 void MathExIntInset::metrics(MetricsInfo &, Dimension &) const
65 lyxerr << "should not happen" << endl;
69 void MathExIntInset::draw(PainterInfo &, int, int) const
71 lyxerr << "should not happen" << endl;
75 void MathExIntInset::maple(MapleStream & os) const
84 os << '=' << cell(2) << ".." << cell(3);
89 void MathExIntInset::maxima(MaximaStream & os) const
91 if ( symbol_ == "int" )
101 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
103 os << cell(1) << ')';
106 void MathExIntInset::mathematica(MathematicaStream & os) const
108 if ( symbol_ == "int" )
110 else if (symbol_ == "sum")
113 os << symbol_ << '[';
116 os << cell(0) << ',';
120 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
122 os << cell(1) << ']';
126 void MathExIntInset::mathmlize(MathMLStream & os) const
128 boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
130 // mathmlize(sym, os);
133 os << cell(0) << "<mo> ⁢ </mo>"
134 << MTag("mrow") << "<mo> ⅆ </mo>"
135 << cell(1) << ETag("mrow");
139 void MathExIntInset::write(WriteStream &) const
141 lyxerr << "should not happen" << endl;