]> 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 33cb4d9f3cbe1e8fe47de26fed59d56be29a1edd..f894782ab5c1366fe195f6ec3a0b5c81c20f49eb 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author André Pönitz
+ * \author André Pönitz
  *
  * Full author contact details are available in file CREDITS.
  */
 
 #include "InsetMath.h"
 
+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:
        ///
@@ -27,53 +27,72 @@ public:
        ///
        explicit InsetMathSymbol(char const * name);
        ///
-       explicit InsetMathSymbol(std::string const & name);
+       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 width() const { return width_; }
+       int kerning(BufferView const *) const override { return kerning_; }
 
        ///
-       bool isRelOp() const;
-       /// do we take scripts?
-       bool isScriptable() const;
-       /// do we take \limits or \nolimits?
-       bool takesLimits() const;
+       mode_type currentMode() const override;
+       ///
+       MathClass mathClass() const override;
+       ///
+       bool isOrdAlpha() 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)
-       std::string 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 override;
        ///
-       void maple(MapleStream &) const;
+       void maxima(MaximaStream &) const override;
        ///
-       void maxima(MaximaStream &) const;
+       void mathematica(MathematicaStream &) const override;
        ///
-       void mathematica(MathematicaStream &) const;
+       void mathmlize(MathMLStream &) const override;
        ///
-       void mathmlize(MathMLStream &) 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 octave(OctaveStream &) const;
+       void octave(OctaveStream &) const override;
        ///
-       void write(WriteStream & os) const;
+       void write(TeXMathStream & os) const override;
        ///
-       void infoize2(std::ostream & os) const;
+       void infoize2(odocstream & os) const override;
+       ///
+       InsetCode lyxCode() const override { return MATH_SYMBOL_CODE; }
 
 private:
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       Inset * clone() const override;
        ///
        latexkeys const * sym_;
        ///
-       mutable int h_;
-       /// cached width
-       mutable int width_;
+       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
+
 #endif