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"
29 class MathMacroTemplate;
32 /** This class contains the data for a macro
33 \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
34 \version November 1996
36 class MathMacro : public MathParInset {
38 /// A macro can only be builded from an existing template
40 MathMacro(boost::shared_ptr<MathMacroTemplate> const &);
41 /// or from another macro.
43 MathMacro(MathMacro const &);
45 void draw(Painter &, int, int);
49 MathedInset * Clone();
51 void Write(std::ostream &, bool fragile);
53 bool setArgumentIdx(int);
55 int getArgumentIdx() const;
57 int getMaxArgumentIdx() const;
59 int GetColumns() const;
61 void GetXY(int &, int &) const;
63 void SetFocus(int, int);
65 MathedArray & GetData();
67 MathedArray const & GetData() const;
69 MathedRowSt * getRowSt() const;
71 void setData(MathedArray const &);
73 MathedTextCodes getTCode() const;
75 bool Permit(short) const;
78 boost::shared_ptr<MathMacroTemplate> tmplate_;
80 struct MacroArgumentBase {
90 std::vector<MacroArgumentBase> args_;
96 MathedTextCodes tcode_;