]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_macrotemplate.h
fix pullArg when pressing <Delete> at the end of an cell
[lyx.git] / src / mathed / math_macrotemplate.h
index bca4647d1ac53733d4951847b8321e06072858ae..64283ab14c802e281a3e161d776a58b649a926a5 100644 (file)
@@ -1,14 +1,8 @@
 // -*- C++ -*-
-#ifndef MATHMACROTEMPLATE
-#define MATHMACROTEMPLATE
+#ifndef MATH_MACROTEMPLATE_H
+#define MATH_MACROTEMPLATE_H
 
-#include <vector>
-
-#include <boost/utility.hpp>
-//#include <boost/smart_ptr.hpp>
-
-#include "math_parinset.h"
-#include "math_macroarg.h"
+#include "math_inset.h"
 
 #ifdef __GNUG__
 #pragma interface
@@ -19,45 +13,31 @@ class MathMacro;
 /** This class contains the macro definition
     \author Alejandro Aguilar Sierra
  */
-class MathMacroTemplate : public MathParInset, public noncopyable {
+//class MathMacroTemplate : public MathInset, boost::noncopyable 
+
+class MathMacroTemplate : public MathInset {
 public:
-       friend class MathMacro;
-       
-       /// A template constructor needs all the data
-       explicit
-       MathMacroTemplate(string const &, int na);
        ///
-       void draw(Painter &, int, int);
+       MathMacroTemplate();
        ///
-       void Metrics();
+       MathMacroTemplate(string const & name, int nargs);
        ///
-       void WriteDef(std::ostream &, bool fragile);
-       /// useful for special insets
-       void setTCode(MathedTextCodes t);
+       MathInset * clone() const;
        ///
-       MathedTextCodes getTCode() const;
+       void Write(std::ostream &, bool fragile) const;
        /// Number of arguments
-       int getNoArgs() const;
-       ///
-       void GetMacroXY(int, int &, int &) const;
+       int numargs() const;
        ///
-       MathParInset * getMacroPar(int) const;
+       void numargs(int);
        ///
-       void SetMacroFocus(int &, int, int);
+       void draw(Painter &, int, int);
        ///
-       void setEditMode(bool);
-       
-       /// Replace the appropriate arguments with a specific macro's data
-       void update(MathMacro const & m);
+       void Metrics(MathStyles st, int asc = 0, int des = 0);
 private:
-       /// Are we in edit mode or not?
-       bool edit_;
-       ///
-       MathedTextCodes tcode_;
        ///
-       //std::vector<boost::shared_ptr<MathMacroArgument> > args_;
-       std::vector<MathMacroArgument> args_;
-       ///
-       int nargs_;
+       int numargs_;
+       /// unimplemented
+       void operator=(MathMacroTemplate const &);
 };
+
 #endif