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, Math & Lyx project.
15 * This code is under the GNU General Public Licence version 2 or later.
24 #include "math_nestinset.h"
25 #include "math_metricsinfo.h"
26 #include "math_macroarg.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 MathNestInset {
38 /// A macro can be built from an existing template
39 explicit MathMacro(string const &);
41 MathMacro(MathMacro const &);
43 void draw(MathPainterInfo & pi, int x, int y) const;
45 void metrics(MathMetricsInfo & mi) const;
47 MathInset * clone() const;
52 bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
54 bool idxLeft(idx_type & idx, pos_type & pos) const;
56 bool idxRight(idx_type & idx, pos_type & pos) const;
59 void validate(LaTeXFeatures &) const;
61 bool isMacro() const { return true; }
63 bool match(MathInset *) const { return false; }
66 void maplize(MapleStream &) const;
68 void mathmlize(MathMLStream &) const;
70 void octavize(OctaveStream &) const;
74 void operator=(MathMacro const &);
78 bool defining() const;
80 void updateExpansion() const;
87 mutable MathArray expanded_;
89 mutable MathMetricsInfo mi_;
91 mutable LyXFont font_;