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
35 * Full author contact details are available in file CREDITS
36 \version November 1996
38 class MathMacro : public MathNestInset {
40 /// A macro can be built from an existing template
41 explicit MathMacro(string const &);
43 MathMacro(MathMacro const &);
45 void draw(MathPainterInfo & pi, int x, int y) const;
47 void metrics(MathMetricsInfo & mi) const;
49 MathInset * clone() const;
54 bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
56 bool idxLeft(idx_type & idx, pos_type & pos) const;
58 bool idxRight(idx_type & idx, pos_type & pos) const;
61 void validate(LaTeXFeatures &) const;
63 bool isMacro() const { return true; }
65 bool match(MathAtom const &) const { return false; }
68 void maplize(MapleStream &) const;
70 void mathmlize(MathMLStream &) const;
72 void octavize(OctaveStream &) const;
76 void operator=(MathMacro const &);
80 bool defining() const;
82 void updateExpansion() const;
89 mutable MathArray expanded_;
91 mutable MathMetricsInfo mi_;
93 mutable LyXFont font_;