3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Alejandro Aguilar Sierra
9 * Full author contact details are available in file CREDITS.
14 #include "math_inset.h"
15 #include "math_mathmlstream.h"
16 #include "math_cursor.h"
19 #include "formulabase.h"
27 BufferView * MathInset::view() const
29 return mathcursor ? mathcursor->formula()->view() : 0;
33 MathInset::size_type MathInset::nargs() const
41 MathArray & MathInset::cell(idx_type)
43 lyxerr << "I don't have a cell 1" << endl;
48 MathArray const & MathInset::cell(idx_type) const
50 lyxerr << "I don't have a cell 2" << endl;
55 MathInset::idx_type MathInset::index(row_type row, col_type col) const
58 lyxerr << "illegal row: " << row << endl;
60 lyxerr << "illegal col: " << col << endl;
64 void MathInset::substitute(MathMacro const &)
68 bool MathInset::idxNext(idx_type &, pos_type &) const
74 bool MathInset::idxRight(idx_type &, pos_type &) const
80 bool MathInset::idxPrev(idx_type &, pos_type &) const
86 bool MathInset::idxLeft(idx_type &, pos_type &) const
92 bool MathInset::idxUpDown(idx_type &, pos_type &, bool, int) const
98 bool MathInset::idxUpDown2(idx_type &, pos_type &, bool, int) const
104 bool MathInset::idxFirst(idx_type &, pos_type &) const
110 bool MathInset::idxLast(idx_type &, pos_type &) const
116 bool MathInset::idxHome(idx_type &, pos_type &) const
122 bool MathInset::idxEnd(idx_type &, pos_type &) const
128 void MathInset::getPos(idx_type, pos_type, int & x, int & y) const
130 lyxerr << "MathInset::getPos() called directly!" << endl;
135 void MathInset::dump() const
137 lyxerr << "---------------------------------------------" << endl;
138 WriteStream wi(lyxerr, false, true);
140 lyxerr << "\n---------------------------------------------" << endl;
144 bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
146 return from <= idx && idx <= to;
150 void MathInset::drawSelection(PainterInfo &,
151 idx_type, pos_type, idx_type, pos_type) const
153 lyxerr << "MathInset::drawSelection() called directly!" << endl;
157 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
160 lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
165 void MathInset::drawT(TextPainter &, int, int) const
168 lyxerr << "MathInset::drawT(Text) called directly!" << endl;
174 void MathInset::write(WriteStream & os) const
176 os << '\\' << name().c_str();
177 os.pendingSpace(true);
181 void MathInset::normalize(NormalStream & os) const
183 os << '[' << name().c_str() << "] ";
187 void MathInset::octave(OctaveStream & os) const
189 NormalStream ns(os.os());
194 void MathInset::maple(MapleStream & os) const
196 NormalStream ns(os.os());
201 void MathInset::maxima(MaximaStream & os) const
203 MapleStream ns(os.os());
208 void MathInset::mathematica(MathematicaStream & os) const
210 NormalStream ns(os.os());
215 void MathInset::mathmlize(MathMLStream & os) const
217 NormalStream ns(os.os());
222 int MathInset::ascii(std::ostream &, int) const
228 int MathInset::linuxdoc(std::ostream &) const
234 int MathInset::docbook(std::ostream &, bool) const
240 string const & MathInset::getType() const
242 static string const t("none");
247 string MathInset::name() const
253 ostream & operator<<(ostream & os, MathAtom const & at)
255 WriteStream wi(os, false, false);
261 string MathInset::fileInsetLabel() const