]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macro.h
macro rework
[lyx.git] / src / mathed / math_macro.h
index 9351d8ea51f367552bd97932f22fd6f908ce6a6c..a1637a7607de4447a88cadbccd060dfc72c12128 100644 (file)
 #ifndef MATH_MACRO_H
 #define MATH_MACRO_H
 
-#include "math_data.h"
 #include "math_nestinset.h"
-#include "metricsinfo.h"
-
-
-class MathMacroTemplate;
+#include "math_data.h"
 
 
 /// This class contains the data for a macro.
-class MathMacro : public MathNestInset {
+class MathMacro : public MathDimInset {
 public:
        /// A macro can be built from an existing template
        explicit MathMacro(std::string const &);
        ///
-       MathMacro(MathMacro const &);
+       std::auto_ptr<InsetBase> clone() const;
+       ///
+       MathMacro * asMacro() { return this; }
+       ///
+       MathMacro const * asMacro() const { return this; }
        ///
        void draw(PainterInfo & pi, int x, int y) const;
        ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
+       void drawExpanded(PainterInfo & pi, int x, int y) const;
        ///
-       virtual std::auto_ptr<InsetBase> clone() const;
+       void metrics(MetricsInfo & mi, Dimension & dim) const;
        ///
-       void dump() const;
-
+       void metricsExpanded(MetricsInfo & mi, Dimension & dim) const;
        ///
-       bool idxUpDown(LCursor & cur, bool up) const;
+       int widthExpanded() const;
        ///
-       bool idxLeft(LCursor & cur) const;
+       std::string name() const;
        ///
-       bool idxRight(LCursor & cur) const;
+       void setExpansion(MathArray const & exp, MathArray const & args) const;
 
        ///
        void validate(LaTeXFeatures &) const;
-       ///
-       bool isMacro() const { return true; }
 
        ///
        void maple(MapleStream &) const;
@@ -61,25 +58,15 @@ public:
        void infoize2(std::ostream &) const;
 
 private:
-       ///
-       void operator=(MathMacro const &);
-       ///
-       std::string name() const;
-       ///
-       bool defining() const;
        ///
        void updateExpansion() const;
-       ///
-       void expand() const;
 
        ///
-       MathAtom & tmplate_;
+       std::string name_;
        ///
        mutable MathArray expanded_;
        ///
-       mutable MetricsInfo mi_;
-       ///
-       mutable LyXFont font_;
+       mutable MathArray args_;
 };