]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/InsetMath.h
Fortify math insets against ulem commands
[lyx.git] / src / mathed / InsetMath.h
index 917011fbb3aae411f1f2cad2d6b4908e92138650..da84af1010c101ef16d084680ae9f97bd5bd625c 100644 (file)
@@ -13,8 +13,6 @@
 #ifndef MATH_INSET_H
 #define MATH_INSET_H
 
-#include "MathData.h"
-
 #include "insets/Inset.h"
 
 
@@ -32,7 +30,8 @@ enum HullType {
        hullFlAlign,
        hullMultline,
        hullGather,
-       hullRegexp
+       hullRegexp,
+       hullUnknown
 };
 
 HullType hullType(docstring const & name);
@@ -44,7 +43,7 @@ Abstract base class for all math objects.  A math insets is for use of the
 math editor only, it isn't a general LyX inset. It's used to represent all
 the math objects.
 
-Math insets do not know there parents, a cursor position or things
+Math insets do not know their parents, a cursor position or things
 like that. They are dumb objects that are contained in other math insets
 (InsetMathNests, in fact) thus forming a tree. The root of this tree is
 always a InsetMathHull, which provides an interface to the Outer World by
@@ -82,16 +81,18 @@ class MaximaStream;
 class MathematicaStream;
 class MathStream;
 class WriteStream;
-class InfoStream;
 
+class MathData;
 class MathMacroTemplate;
 class MathMacro;
-class MathPosFinder;
 class Cursor;
 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:
@@ -161,8 +162,12 @@ public:
 
        /// 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; }
+       /// identifies a binary operators (used for spacing)
+       virtual bool isMathBin() const { return false; }
+       /// identifies relational operators (used for spacing and splitting equations)
+       virtual bool isMathRel() const { return false; }
+       /// identifies punctuation (used for spacing)
+       virtual bool isMathPunct() const { return false; }
        /// will this get written as a single block in {..}
        virtual bool extraBraces() const { return false; }
 
@@ -225,6 +230,8 @@ public:
        bool isInToc() const { return true; }
        ///
        InsetCode lyxCode() const { return MATH_CODE; }
+       ///
+       uid_type id() const { return this; }
 };
 
 ///