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_scriptinset.h"
16 #include "math_mathmlstream.h"
17 #include "math_cursor.h"
20 #include "frontends/LyXView.h"
21 #include "frontends/Dialogs.h"
22 #include "BufferView.h"
23 #include "formulabase.h"
29 BufferView * MathInset::view() const
31 return mathcursor ? mathcursor->formula()->view() : 0;
35 MathInset::size_type MathInset::nargs() const
43 MathArray & MathInset::cell(idx_type)
45 lyxerr << "I don't have a cell 1" << endl;
50 MathArray const & MathInset::cell(idx_type) const
52 lyxerr << "I don't have a cell 2" << endl;
57 MathInset::idx_type MathInset::index(row_type row, col_type col) const
60 lyxerr << "illegal row: " << row << endl;
62 lyxerr << "illegal col: " << col << endl;
66 void MathInset::substitute(MathMacro const &)
70 bool MathInset::idxNext(idx_type &, pos_type &) const
76 bool MathInset::idxRight(idx_type &, pos_type &) const
82 bool MathInset::idxPrev(idx_type &, pos_type &) const
88 bool MathInset::idxLeft(idx_type &, pos_type &) const
94 bool MathInset::idxUpDown(idx_type &, pos_type &, bool, int) const
100 bool MathInset::idxUpDown2(idx_type &, pos_type &, bool, int) const
106 bool MathInset::idxFirst(idx_type &, pos_type &) const
112 bool MathInset::idxLast(idx_type &, pos_type &) const
118 bool MathInset::idxHome(idx_type &, pos_type &) const
124 bool MathInset::idxEnd(idx_type &, pos_type &) const
130 void MathInset::getPos(idx_type, pos_type, int & x, int & y) const
132 lyxerr << "MathInset::getPos() called directly!" << endl;
137 void MathInset::dump() const
139 lyxerr << "---------------------------------------------" << endl;
140 WriteStream wi(lyxerr, false, true);
142 lyxerr << "\n---------------------------------------------" << endl;
146 bool MathInset::idxBetween(idx_type idx, idx_type from, idx_type to) const
148 return from <= idx && idx <= to;
152 void MathInset::drawSelection(PainterInfo &,
153 idx_type, pos_type, idx_type, pos_type) const
155 lyxerr << "MathInset::drawSelection() called directly!" << endl;
159 void MathInset::metricsT(TextMetricsInfo const &, Dimension &) const
162 lyxerr << "MathInset::metricsT(Text) called directly!" << endl;
167 void MathInset::drawT(TextPainter &, int, int) const
170 lyxerr << "MathInset::drawT(Text) called directly!" << endl;
176 void MathInset::write(WriteStream & os) const
178 os << '\\' << name().c_str();
179 os.pendingSpace(true);
183 void MathInset::normalize(NormalStream & os) const
185 os << '[' << name().c_str() << "] ";
189 void MathInset::octave(OctaveStream & os) const
191 NormalStream ns(os.os());
196 void MathInset::maple(MapleStream & os) const
198 NormalStream ns(os.os());
203 void MathInset::maxima(MaximaStream & os) const
205 MapleStream ns(os.os());
210 void MathInset::mathematica(MathematicaStream & os) const
212 NormalStream ns(os.os());
217 void MathInset::mathmlize(MathMLStream & os) const
219 NormalStream ns(os.os());
224 int MathInset::ascii(std::ostream &, int) const
230 int MathInset::linuxdoc(std::ostream &) const
236 int MathInset::docbook(std::ostream &, bool) const
242 string const & MathInset::getType() const
244 static string const t("none");
249 string MathInset::name() const
255 ostream & operator<<(ostream & os, MathAtom const & at)
257 WriteStream wi(os, false, false);
263 string MathInset::fileInsetLabel() const