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.
16 #include "math_nestinset.h"
17 #include "math_data.h"
18 #include "math_nestinset.h"
19 #include "math_macrotable.h"
22 /// This class contains the data for a macro.
23 class MathMacro : public MathNestInset {
25 /// A macro can be built from an existing template
26 MathMacro(std::string const & name, int numargs);
28 void draw(PainterInfo & pi, int x, int y) const;
30 void drawExpanded(PainterInfo & pi, int x, int y) const;
32 void metrics(MetricsInfo & mi, Dimension & dim) const;
34 std::string name() const;
36 void setExpansion(MathArray const & exp, MathArray const & args) const;
39 void validate(LaTeXFeatures &) const;
42 void maple(MapleStream &) const;
44 void mathmlize(MathMLStream &) const;
46 void octave(OctaveStream &) const;
48 void infoize(std::ostream &) const;
50 void infoize2(std::ostream &) const;
53 virtual std::auto_ptr<InsetBase> doClone() const;
55 void updateExpansion() const;
61 /// the unexpanded macro defintition
62 mutable MathArray tmpl_;
63 /// the matcro substituted with our args
64 mutable MathArray expanded_;