2 * \file InsetMathExInt.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 "InsetMathExInt.h"
15 #include "MathStream.h"
16 #include "MathStream.h"
17 #include "InsetMathSymbol.h"
20 #include <boost/scoped_ptr.hpp>
31 InsetMathExInt::InsetMathExInt(docstring const & name)
32 : InsetMathNest(4), symbol_(name)
41 auto_ptr<InsetBase> InsetMathExInt::doClone() const
43 return auto_ptr<InsetBase>(new InsetMathExInt(*this));
47 void InsetMathExInt::symbol(docstring const & symbol)
53 bool InsetMathExInt::hasScripts() const
55 // take empty upper bound as "no scripts"
56 return !cell(3).empty();
61 void InsetMathExInt::normalize(NormalStream & os) const
63 os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
64 << cell(2) << ' ' << cell(3) << ']';
68 void InsetMathExInt::metrics(MetricsInfo &, Dimension &) const
70 lyxerr << "should not happen" << endl;
74 void InsetMathExInt::draw(PainterInfo &, int, int) const
76 lyxerr << "should not happen" << endl;
80 void InsetMathExInt::maple(MapleStream & os) const
89 os << '=' << cell(2) << ".." << cell(3);
94 void InsetMathExInt::maxima(MaximaStream & os) const
96 if ( symbol_ == "int" )
102 os << cell(0) << ',';
106 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
108 os << cell(1) << ')';
111 void InsetMathExInt::mathematica(MathematicaStream & os) const
113 if ( symbol_ == "int" )
115 else if (symbol_ == "sum")
118 os << symbol_ << '[';
121 os << cell(0) << ',';
125 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
127 os << cell(1) << ']';
131 void InsetMathExInt::mathmlize(MathStream & os) const
133 boost::scoped_ptr<InsetMathSymbol> sym(new InsetMathSymbol(symbol_));
135 // mathmlize(sym, os);
138 os << cell(0) << "<mo> ⁢ </mo>"
139 << MTag("mrow") << "<mo> ⅆ </mo>"
140 << cell(1) << ETag("mrow");
144 void InsetMathExInt::write(WriteStream &) const
146 lyxerr << "should not happen" << endl;