#ifndef MATH_INSET_H
#define MATH_INSET_H
+#include "math_data.h"
+
#include "insets/insetbase.h"
#include <string>
class OutputParams;
class MathArrayInset;
class MathAMSArrayInset;
+class MathBraceInset;
class MathCharInset;
class MathDelimInset;
class MathFracInset;
class RefInset;
-class MathArray;
-class MathAtom;
-
class NormalStream;
class OctaveStream;
class MapleStream;
public:
/// identification as math inset
MathInset * asMathInset() { return this; }
+ /// 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);
- /// draw selection between two positions
- virtual void drawSelection(PainterInfo & pi,
- idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) 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;
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; }
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; }
virtual std::string const & getType() const;
/// change type
virtual void mutate(std::string const &) {}
- /// how is the inset called in the .lyx file?
- virtual std::string fileInsetLabel() 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 &);