A bit more re-organization.
[lyx.git] / src / mathed / InsetMathUnknown.cpp
blob2cd11c2a8666ed1f537ab58ac6e026fcbe3b6552
1 /**
2 * \file InsetMathUnknown.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author André Pönitz
8 * Full author contact details are available in file CREDITS.
9 */
11 #include <config.h>
13 #include "InsetMathUnknown.h"
14 #include "MathSupport.h"
15 #include "MathAtom.h"
16 #include "MathStream.h"
17 #include "MathStream.h"
19 #include "frontends/Painter.h"
22 namespace lyx {
24 InsetMathUnknown::InsetMathUnknown(docstring const & nm,
25 docstring const & selection, bool final, bool black)
26 : name_(nm), final_(final), black_(black), selection_(selection)
30 docstring InsetMathUnknown::name() const
32 return name_;
36 void InsetMathUnknown::setName(docstring const & name)
38 name_ = name;
42 void InsetMathUnknown::normalize(NormalStream & os) const
44 os << "[unknown " << name_ << ']';
48 void InsetMathUnknown::metrics(MetricsInfo & mi, Dimension & dim) const
50 mathed_string_dim(mi.base.font, name_, dim);
51 docstring::const_reverse_iterator rit = name_.rbegin();
52 kerning_ = mathed_char_kerning(mi.base.font, *rit);
56 void InsetMathUnknown::draw(PainterInfo & pi, int x, int y) const
58 if (black_)
59 drawStrBlack(pi, x, y, name_);
60 else
61 drawStrRed(pi, x, y, name_);
65 void InsetMathUnknown::finalize()
67 final_ = true;
71 bool InsetMathUnknown::final() const
73 return final_;
77 void InsetMathUnknown::maple(MapleStream & os) const
79 os << name_;
83 void InsetMathUnknown::mathematica(MathematicaStream & os) const
85 os << name_;
89 void InsetMathUnknown::mathmlize(MathStream & os) const
91 os << MTag("mi") << name_ << ETag("mi");
95 void InsetMathUnknown::octave(OctaveStream & os) const
97 os << name_;
101 } // namespace lyx