X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMath.h;h=5e5f492dc925a260e0989940b142eff92c122628;hb=0385ef0e192a779aed13aab0fd4a9bd4a03f37e0;hp=555762c8c7bab3e568b8d9247475e612b1c96ef5;hpb=ff4460603e3888948b46f0ab5bfa69a862d538ad;p=lyx.git diff --git a/src/mathed/InsetMath.h b/src/mathed/InsetMath.h index 555762c8c7..5e5f492dc9 100644 --- a/src/mathed/InsetMath.h +++ b/src/mathed/InsetMath.h @@ -45,7 +45,7 @@ math editor only, it isn't a general LyX inset. It's used to represent all the math objects. Math insets do not know there parents, a cursor position or things -like that. The are dumb object that are contained in other math insets +like that. They are dumb objects that are contained in other math insets (InsetMathNests, in fact) thus forming a tree. The root of this tree is always a InsetMathHull, which provides an interface to the Outer World by inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset. @@ -73,6 +73,7 @@ class InsetMathUnknown; class InsetMathRef; +class HtmlStream; class NormalStream; class OctaveStream; class MapleStream; @@ -101,6 +102,8 @@ public: InsetMath const * asInsetMath() const { return this; } /// this is overridden in math text insets (i.e. mbox) bool inMathed() const { return true; } + /// + virtual docstring name() const; /// this is overridden by specific insets virtual mode_type currentMode() const { return MATH_MODE; } @@ -165,8 +168,6 @@ public: /// identifies things that can get \limits or \nolimits virtual bool takesLimits() const { return false; } - /// char char code if possible - virtual void handleFont(docstring const &) {} /// replace things by other things virtual void replace(ReplaceData &) {} /// do we contain a given subsequence? @@ -186,13 +187,18 @@ public: virtual void maxima(MaximaStream &) const; /// write content as something readable by Mathematica virtual void mathematica(MathematicaStream &) const; - /// write content as something resembling MathML + /// write content as MathML virtual void mathmlize(MathStream &) const; + /// write content as HTML, best we can. + /// the idea for this, and some of the details, come from + /// eLyXer, written by Alex Fernandez. no code is borrowed. rather, + /// we try to mimic how eLyXer outputs some math. + virtual void htmlize(HtmlStream &) const; /// write content as something readable by Octave virtual void octave(OctaveStream &) const; /// plain text output in ucs4 encoding - int plaintext(odocstream &, OutputParams const &) const; + int plaintext(odocstringstream &, OutputParams const &, size_t) const; /// dump content to stderr for debugging virtual void dump() const; @@ -210,6 +216,8 @@ public: /// superscript kerning virtual int kerning(BufferView const *) const { return 0; } /// + bool isInToc() const { return true; } + /// InsetCode lyxCode() const { return MATH_CODE; } };