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 "math_parinset.h"
27 class MathMacroTemplate;
30 /** This class contains the data for a macro
31 \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
32 \version November 1996
34 class MathMacro : public MathParInset
37 /// A macro can only be builded from an existing template
39 MathMacro(MathMacroTemplate *);
40 /// or from another macro.
42 MathMacro(MathMacro *);
46 void draw(Painter &, int, int);
50 MathedInset * Clone();
52 void Write(std::ostream &, bool fragile);
54 bool setArgumentIdx(int);
56 int getArgumentIdx() const;
58 int getMaxArgumentIdx() const;
60 int GetColumns() const;
62 void GetXY(int &, int &) const;
64 void SetFocus(int, int);
66 MathedArray * GetData();
68 MathedRowSt * getRowSt() const;
70 void setData(MathedArray *);
72 MathedTextCodes getTCode() const;
74 bool Permit(short) const;
77 MathMacroTemplate * tmplate_;
79 struct MacroArgumentBase {
80 /// Position of the macro
90 : x(0), y(0), row(0), array(0)
93 std::vector<MacroArgumentBase> args_;
99 MathedTextCodes tcode_;