4 * Purpose: Declaration of macro class for mathed
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: November 1996
7 * Description: WYSIWYG math macros
11 * Copyright: 1996, 1997 Alejandro Aguilar Sierra
13 * Version: 0.2, Mathed & Lyx project.
15 * This code is under the GNU General Public Licence version 2 or later.
25 #include <boost/smart_ptr.hpp>
27 #include "math_parinset.h"
28 #include "math_macroarg.h"
30 class MathMacroTemplate;
33 /** This class contains the data for a macro
34 \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
35 \version November 1996
37 class MathMacro : public MathParInset {
39 /// A macro can only be built from an existing template
41 MathMacro(boost::shared_ptr<MathMacroTemplate> const &);
43 void draw(Painter &, int, int);
47 MathedInset * Clone();
49 void Write(std::ostream &, bool fragile);
51 bool setArgumentIdx(int);
53 int getArgumentIdx() const;
55 int getMaxArgumentIdx() const;
57 int GetColumns() const;
59 void GetXY(int &, int &) const;
61 void SetFocus(int, int);
63 MathedArray & GetData();
65 MathedArray const & GetData() const;
67 void setData(MathedArray const &);
69 MathedTextCodes getTCode() const;
71 bool Permit(short) const;
73 MathMacroArgument const & getArg(int i) const;
74 //boost::shared_ptr<MathMacroArgument> getArg(int i);
77 boost::shared_ptr<MathMacroTemplate> tmplate_;
79 //std::vector<boost::shared_ptr<MathMacroArgument> > args_;
80 std::vector<MathMacroArgument> args_;
86 MathedTextCodes tcode_;