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 built from an existing template
40 MathMacro(boost::shared_ptr<MathMacroTemplate> const &);
42 void draw(Painter &, int, int);
46 MathedInset * Clone();
48 void Write(std::ostream &, bool fragile);
50 bool setArgumentIdx(int);
52 int getArgumentIdx() const;
54 int getMaxArgumentIdx() const;
56 int GetColumns() const;
58 void GetXY(int &, int &) const;
60 void SetFocus(int, int);
62 MathedArray & GetData();
64 MathedArray const & GetData() const;
66 MathedRowSt * getRowSt() const;
68 void setData(MathedArray const &);
70 MathedTextCodes getTCode() const;
72 bool Permit(short) const;
75 boost::shared_ptr<MathMacroTemplate> tmplate_;
77 struct MacroArgumentBase {
87 std::vector<MacroArgumentBase> args_;
93 MathedTextCodes tcode_;