]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMathSymbol.h
Assure correct spacing of colored items in mathed
[lyx.git] / src / mathed / InsetMathSymbol.h
index 74b0b9180f878ee03a8135ee502fa8bcfd78d66d..bbf37f9673464a07e747ba37292510212c1b611d 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"
 
-#include "lyxfont.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:
        ///
@@ -33,20 +29,24 @@ public:
        ///
        explicit InsetMathSymbol(docstring const & name);
        ///
-       bool metrics(MetricsInfo & mi, Dimension & dim) const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
        void draw(PainterInfo &, int x, int y) const;
        ///
-       int kerning() const { return kerning_; }
+       int kerning(BufferView const *) const { return kerning_; }
 
        ///
-       bool isRelOp() const;
+       mode_type currentMode() const;
+       ///
+       MathClass mathClass() const;
        ///
        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() const;
+       /// whether the inset has limit-like sub/superscript
+       Limits limits() const { return limits_; }
+       /// sets types of sub/superscripts
+       void limits(Limits lim) { limits_ = lim; }
        /// identifies SymbolInset as such
        InsetMathSymbol const * asSymbolInset() const { return this; }
        /// the LaTeX name of the symbol (without the backslash)
@@ -65,24 +65,32 @@ public:
        ///
        void mathmlize(MathStream &) const;
        ///
+       void htmlize(HtmlStream &) const;
+       /// \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 write(WriteStream & os) const;
        ///
        void infoize2(odocstream & os) const;
+       ///
+       InsetCode lyxCode() const { return MATH_SYMBOL_CODE; }
 
 private:
-       virtual std::auto_ptr<InsetBase> doClone() const;
+       virtual Inset * clone() const;
        ///
        latexkeys const * sym_;
        ///
-       mutable int h_;
-       /// cached superscript kerning
-       mutable int kerning_;
-       ///
-       mutable bool scriptable_;
+       Limits limits_ = AUTO_LIMITS;
+
+       // FIXME: these depend on BufferView
+
        ///
-       mutable LyXFont font_cache_;
+       mutable int h_ = 0;
+       /// cached superscript kerning
+       mutable int kerning_ = 0;
 };
 
 } // namespace lyx