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.
21 #include "math_nestinset.h"
22 #include "math_metricsinfo.h"
23 #include "math_macroarg.h"
26 class MathMacroTemplate;
29 /** This class contains the data for a macro
30 * \author Alejandro Aguilar Sierra
32 * Full author contact details are available in file CREDITS
33 \version November 1996
35 class MathMacro : public MathNestInset {
37 /// A macro can be built from an existing template
38 explicit MathMacro(string const &);
40 MathMacro(MathMacro const &);
42 void draw(MathPainterInfo & pi, int x, int y) const;
44 void metrics(MathMetricsInfo & mi) const;
46 MathInset * clone() const;
51 bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
53 bool idxLeft(idx_type & idx, pos_type & pos) const;
55 bool idxRight(idx_type & idx, pos_type & pos) const;
58 void validate(LaTeXFeatures &) const;
60 bool isMacro() const { return true; }
62 bool match(MathAtom const &) const { return false; }
65 void maplize(MapleStream &) const;
67 void mathmlize(MathMLStream &) const;
69 void octavize(OctaveStream &) const;
71 void infoize(std::ostream &) const;
73 void infoize2(std::ostream &) const;
77 void operator=(MathMacro const &);
81 bool defining() const;
83 void updateExpansion() const;
90 mutable MathArray expanded_;
92 mutable MathMetricsInfo mi_;
94 mutable LyXFont font_;