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"
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 bool InsetMathExInt::metrics(MetricsInfo &, Dimension &) const
70 lyxerr << "should not happen" << endl;
75 void InsetMathExInt::draw(PainterInfo &, int, int) const
77 lyxerr << "should not happen" << endl;
81 void InsetMathExInt::maple(MapleStream & os) const
90 os << '=' << cell(2) << ".." << cell(3);
95 void InsetMathExInt::maxima(MaximaStream & os) const
97 if ( symbol_ == "int" )
100 os << symbol_ << '(';
103 os << cell(0) << ',';
107 os << cell(1) << ',' << cell(2) << ',' << cell(3) << ')';
109 os << cell(1) << ')';
112 void InsetMathExInt::mathematica(MathematicaStream & os) const
114 if ( symbol_ == "int" )
116 else if (symbol_ == "sum")
119 os << symbol_ << '[';
122 os << cell(0) << ',';
126 os << '{' << cell(1) << ',' << cell(2) << ',' << cell(3) << "}]";
128 os << cell(1) << ']';
132 void InsetMathExInt::mathmlize(MathStream & os) const
134 boost::scoped_ptr<InsetMathSymbol> sym(new InsetMathSymbol(symbol_));
136 // mathmlize(sym, os);
139 os << cell(0) << "<mo> ⁢ </mo>"
140 << MTag("mrow") << "<mo> ⅆ </mo>"
141 << cell(1) << ETag("mrow");
145 void InsetMathExInt::write(WriteStream &) const
147 lyxerr << "should not happen" << endl;