X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fmathed%2FInsetMathSymbol.h;h=f894782ab5c1366fe195f6ec3a0b5c81c20f49eb;hb=7b7322b831f1bd916293b0e20c827db429ed3773;hp=5382f72e85712f3fe7ed510465eefdd683070165;hpb=0facb603fefec1ecc927f77bcf6228ca1f035444;p=lyx.git diff --git a/src/mathed/InsetMathSymbol.h b/src/mathed/InsetMathSymbol.h index 5382f72e85..f894782ab5 100644 --- a/src/mathed/InsetMathSymbol.h +++ b/src/mathed/InsetMathSymbol.h @@ -19,9 +19,7 @@ namespace lyx { class latexkeys; -/** "normal" symbols that don't take limits and don't grow in displayed - * formulae. - */ +// \xxx symbols that may take limits or grow in displayed formulæ. class InsetMathSymbol : public InsetMath { public: /// @@ -31,56 +29,68 @@ public: /// explicit InsetMathSymbol(docstring const & name); /// - void metrics(MetricsInfo & mi, Dimension & dim) const; + void metrics(MetricsInfo & mi, Dimension & dim) const override; /// - void draw(PainterInfo &, int x, int y) const; + void draw(PainterInfo &, int x, int y) const override; /// - int kerning(BufferView const *) const { return kerning_; } + int kerning(BufferView const *) const override { return kerning_; } /// - bool isRelOp() const; + mode_type currentMode() const override; + /// + MathClass mathClass() const override; /// bool isOrdAlpha() const; - /// do we take scripts? - bool isScriptable() const; - /// do we take \limits or \nolimits? - bool takesLimits() const; + /// The default limits value + Limits defaultLimits(bool display) const override; + /// whether the inset has limit-like sub/superscript + Limits limits() const override { return limits_; } + /// sets types of sub/superscripts + void limits(Limits lim) override { limits_ = lim; } /// identifies SymbolInset as such - InsetMathSymbol const * asSymbolInset() const { return this; } + InsetMathSymbol const * asSymbolInset() const override { return this; } /// the LaTeX name of the symbol (without the backslash) - docstring name() const; + docstring name() const override; /// request "external features" - void validate(LaTeXFeatures & features) const; + void validate(LaTeXFeatures & features) const override; /// - void normalize(NormalStream &) const; + void normalize(NormalStream &) const override; /// - void maple(MapleStream &) const; + void maple(MapleStream &) const override; /// - void maxima(MaximaStream &) const; + void maxima(MaximaStream &) const override; /// - void mathematica(MathematicaStream &) const; + void mathematica(MathematicaStream &) const override; /// - void mathmlize(MathStream &) const; + void mathmlize(MathMLStream &) const override; /// - void octave(OctaveStream &) const; + void htmlize(HtmlStream &) const override; + /// \param spacing controls whether we print spaces around + /// "operator"-type symbols or just print them raw + void htmlize(HtmlStream &, bool spacing) const; /// - void write(WriteStream & os) const; + void octave(OctaveStream &) const override; /// - void infoize2(odocstream & os) const; + void write(TeXMathStream & os) const override; /// - InsetCode lyxCode() const { return MATH_SYMBOL_CODE; } + void infoize2(odocstream & os) const override; + /// + InsetCode lyxCode() const override { return MATH_SYMBOL_CODE; } private: - virtual Inset * clone() const; + Inset * clone() const override; /// latexkeys const * sym_; /// - mutable int h_; - /// cached superscript kerning - mutable int kerning_; + Limits limits_ = AUTO_LIMITS; + + // FIXME: these depend on BufferView + /// - mutable bool scriptable_; + mutable int h_ = 0; + /// cached superscript kerning + mutable int kerning_ = 0; }; } // namespace lyx