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"
20 /// This class contains the data for a macro.
21 class MathMacro : public MathDimInset {
23 /// A macro can be built from an existing template
24 explicit MathMacro(std::string const &);
26 std::auto_ptr<InsetBase> clone() const;
28 MathMacro * asMacro() { return this; }
30 MathMacro const * asMacro() const { return this; }
32 void draw(PainterInfo & pi, int x, int y) const;
34 void drawExpanded(PainterInfo & pi, int x, int y) const;
36 void metrics(MetricsInfo & mi, Dimension & dim) const;
38 void metricsExpanded(MetricsInfo & mi, Dimension & dim) const;
40 int widthExpanded() const;
42 std::string name() const;
44 void setExpansion(MathArray const & exp, MathArray const & args) const;
47 void validate(LaTeXFeatures &) const;
50 void maple(MapleStream &) const;
52 void mathmlize(MathMLStream &) const;
54 void octave(OctaveStream &) const;
56 void infoize(std::ostream &) const;
58 void infoize2(std::ostream &) const;
62 void updateExpansion() const;
67 mutable MathArray expanded_;
69 mutable MathArray args_;