]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.h
float2string #4 (Spacing)
[lyx.git] / src / mathed / math_inset.h
index 557cd9825fb2fdab2b93219ff3d7d69c9c9673b2..d2b26bc21ac82413efc24c6732f8ebc3933b5fc6 100644 (file)
@@ -13,6 +13,8 @@
 #ifndef MATH_INSET_H
 #define MATH_INSET_H
 
+#include "math_data.h"
+
 #include "insets/insetbase.h"
 
 #include <string>
@@ -34,6 +36,7 @@ inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset.
 class OutputParams;
 class MathArrayInset;
 class MathAMSArrayInset;
+class MathBraceInset;
 class MathCharInset;
 class MathDelimInset;
 class MathFracInset;
@@ -51,9 +54,6 @@ class MathUnknownInset;
 
 class RefInset;
 
-class MathArray;
-class MathAtom;
-
 class NormalStream;
 class OctaveStream;
 class MapleStream;
@@ -80,8 +80,6 @@ public:
        /// this is overridden in math text insets (i.e. mbox)
        bool inMathed() const { return true; }
 
-       /// substitutes macro arguments if necessary
-       virtual void substitute(MathMacro const & macro);
        /// the ascent of the inset above the baseline
        /// compute the size of the object for text based drawing
        virtual void metricsT(TextMetricsInfo const & mi, Dimension & dim) const;
@@ -98,6 +96,7 @@ public:
        virtual MathAMSArrayInset const * asAMSArrayInset() const { return 0; }
        virtual MathArrayInset          * asArrayInset()          { return 0; }
        virtual MathArrayInset const    * asArrayInset() const    { return 0; }
+       virtual MathBraceInset const    * asBraceInset() const    { return 0; }
        virtual MathCharInset const     * asCharInset() const     { return 0; }
        virtual MathDelimInset          * asDelimInset()          { return 0; }
        virtual MathDelimInset const    * asDelimInset() const    { return 0; }
@@ -109,6 +108,8 @@ public:
        virtual MathGridInset const     * asGridInset() const     { return 0; }
        virtual MathHullInset           * asHullInset()           { return 0; }
        virtual MathHullInset const     * asHullInset() const     { return 0; }
+       virtual MathMacro               * asMacro()               { return 0; }
+       virtual MathMacro const         * asMacro() const         { return 0; }
        virtual MathMacroTemplate       * asMacroTemplate()       { return 0; }
        virtual MathMacroTemplate const * asMacroTemplate() const { return 0; }
        virtual MathMatrixInset const   * asMatrixInset() const   { return 0; }
@@ -175,6 +176,9 @@ public:
        virtual void mutate(std::string const &) {}
        /// usually the latex name
        virtual std::string name() const;
+
+       /// math stuff usually isn't allowed in text mode
+       virtual bool allowedIn(mode_type mode) const { return mode == MATH_MODE; }
 };
 
 std::ostream & operator<<(std::ostream &, MathAtom const &);