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.
27 #include "math_nestinset.h"
28 #include "math_macroarg.h"
31 class MathMacroTemplate;
34 /** This class contains the data for a macro
35 \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
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(Painter &, int x, int y) const;
47 void metrics(MathMetricsInfo const & st) const;
49 MathInset * clone() const;
54 bool idxUpDown(idx_type &, bool up) const;
56 bool idxLeft(idx_type &, pos_type &) const;
58 bool idxRight(idx_type &, pos_type &) const;
61 void validate(LaTeXFeatures &) const;
63 bool isMacro() const { return true; }
65 bool match(MathInset *) const { return false; }
68 void normalize(NormalStream &) const;
70 void maplize(MapleStream &) const;
72 void mathmlize(MathMLStream &) const;
74 void octavize(OctaveStream &) const;
76 void write(WriteStream & os) const;
80 void operator=(MathMacro const &);
82 char const * name() const;
84 bool defining() const;
86 void updateExpansion() const;
93 mutable MathXArray expanded_;
95 mutable MathMetricsInfo mi_;
97 mutable LyXFont font_;