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 idxUp(idx_type &) const;
56 bool idxDown(idx_type &) const;
58 bool idxLeft(idx_type &, pos_type &) const;
60 bool idxRight(idx_type &, pos_type &) const;
63 void validate(LaTeXFeatures &) const;
65 bool isMacro() const { return true; }
67 bool match(MathInset *) const { return false; }
70 void normalize(NormalStream &) const;
72 void maplize(MapleStream &) const;
74 void mathmlize(MathMLStream &) const;
76 void octavize(OctaveStream &) const;
78 void write(WriteStream & os) const;
82 void operator=(MathMacro const &);
84 char const * name() const;
86 bool defining() const;
88 void updateExpansion() const;
93 mutable MathXArray expanded_;
95 mutable MathMetricsInfo mi_;
97 mutable LyXFont font_;