4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
10 * Full author contact details are available in file CREDITS.
17 #include "math_nestinset.h"
18 #include "metricsinfo.h"
19 #include "math_macroarg.h"
22 class MathMacroTemplate;
25 /// This class contains the data for a macro.
26 class MathMacro : public MathNestInset {
28 /// A macro can be built from an existing template
29 explicit MathMacro(string const &);
31 MathMacro(MathMacro const &);
33 void draw(PainterInfo & pi, int x, int y) const;
35 void metrics(MetricsInfo & mi, Dimension & dim) const;
37 virtual std::auto_ptr<InsetBase> clone() const;
42 bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
44 bool idxLeft(idx_type & idx, pos_type & pos) const;
46 bool idxRight(idx_type & idx, pos_type & pos) const;
49 void validate(LaTeXFeatures &) const;
51 bool isMacro() const { return true; }
53 bool match(MathAtom const &) const { return false; }
56 void maple(MapleStream &) const;
58 void mathmlize(MathMLStream &) const;
60 void octave(OctaveStream &) const;
62 void infoize(std::ostream &) const;
64 void infoize2(std::ostream &) const;
68 void operator=(MathMacro const &);
72 bool defining() const;
74 void updateExpansion() const;
81 mutable MathArray expanded_;
83 mutable MetricsInfo mi_;
85 mutable LyXFont font_;