]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMath.h
Account for old versions of Pygments
[lyx.git] / src / mathed / InsetMath.h
index b23ffb5179e1ef542352e49673ded594d5710a86..81cad09b486fd692b2643064b77273760de46d45 100644 (file)
 #ifndef MATH_INSET_H
 #define MATH_INSET_H
 
-#include "MathData.h"
+#include "MathClass.h"
 
 #include "insets/Inset.h"
 
-#include "TexRow.h"
-
 
 namespace lyx {
 
@@ -55,7 +53,10 @@ inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset.
 
 */
 
+class Cursor;
 class OutputParams;
+class MetricsInfo;
+
 class InsetMathArray;
 class InsetMathAMSArray;
 class InsetMathBrace;
@@ -74,7 +75,6 @@ class InsetMathSpace;
 class InsetMathSpecialChar;
 class InsetMathSymbol;
 class InsetMathUnknown;
-
 class InsetMathRef;
 
 class HtmlStream;
@@ -86,13 +86,17 @@ class MathematicaStream;
 class MathStream;
 class WriteStream;
 
+class MathData;
 class MathMacroTemplate;
 class MathMacro;
-class Cursor;
+class MathRow;
 class TextPainter;
 class TextMetricsInfo;
 class ReplaceData;
 
+/// Type of unique identifiers for math insets (used in TexRow)
+typedef void const * uid_type;
+
 
 class InsetMath : public Inset {
 public:
@@ -110,6 +114,11 @@ public:
        /// this is overridden by specific insets
        virtual mode_type currentMode() const { return MATH_MODE; }
 
+       // The possible marker types for math insets
+       enum marker_type { NO_MARKER, MARKER2, MARKER, BOX_MARKER };
+       /// this is overridden by insets with specific edit marker type
+       virtual marker_type marker(BufferView const *) const;
+
        /// 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;
@@ -160,10 +169,21 @@ public:
        virtual InsetMathRef            * asRefInset()            { return 0; }
        virtual InsetMathSpecialChar const * asSpecialCharInset() const { return 0; }
 
+       /// The class of the math object (used primarily for spacing)
+       virtual MathClass mathClass() const;
+       /// Add this inset to a math row. Return true if contents got added
+       virtual bool addToMathRow(MathRow &, MetricsInfo & mi) const;
+       /// Hook that is run before metrics computation starts
+       virtual void beforeMetrics() const {}
+       /// Hook that is run after metrics computation
+       virtual void afterMetrics() const {}
+       /// Hook that is run before actual drawing
+       virtual void beforeDraw(PainterInfo const &) const {}
+       /// Hook that is run after drawing
+       virtual void afterDraw(PainterInfo const &) const {}
+
        /// identifies things that can get scripts
        virtual bool isScriptable() const { return false; }
-       /// is the a relational operator (used for splitting equations)
-       virtual bool isRelOp() const { return false; }
        /// will this get written as a single block in {..}
        virtual bool extraBraces() const { return false; }
 
@@ -220,7 +240,7 @@ public:
        /// math stuff usually isn't allowed in text mode
        virtual bool allowedIn(mode_type mode) const { return mode == MATH_MODE; }
 
-       /// superscript kerning
+       /// Italic correction as described in InsetMathScript.h
        virtual int kerning(BufferView const *) const { return 0; }
        ///
        bool isInToc() const { return true; }