]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSymbol.h
g-brief loads babel internally. So don't load it ourselves.
[lyx.git] / src / mathed / InsetMathSymbol.h
index 5382f72e85712f3fe7ed510465eefdd683070165..f894782ab5c1366fe195f6ec3a0b5c81c20f49eb 100644 (file)
@@ -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