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_data.h"
17 #include "math_nestinset.h"
18 #include "metricsinfo.h"
21 class MathMacroTemplate;
24 /// This class contains the data for a macro.
25 class MathMacro : public MathNestInset {
27 /// A macro can be built from an existing template
28 explicit MathMacro(std::string const &);
30 MathMacro(MathMacro const &);
32 void draw(PainterInfo & pi, int x, int y) const;
34 void metrics(MetricsInfo & mi, Dimension & dim) const;
36 virtual std::auto_ptr<InsetBase> clone() const;
41 bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
43 bool idxLeft(idx_type & idx, pos_type & pos) const;
45 bool idxRight(idx_type & idx, pos_type & pos) const;
48 void validate(LaTeXFeatures &) const;
50 bool isMacro() const { return true; }
53 void maple(MapleStream &) const;
55 void mathmlize(MathMLStream &) const;
57 void octave(OctaveStream &) const;
59 void infoize(std::ostream &) const;
61 void infoize2(std::ostream &) const;
65 void operator=(MathMacro const &);
67 std::string name() const;
69 bool defining() const;
71 void updateExpansion() const;
78 mutable MathArray expanded_;
80 mutable MetricsInfo mi_;
82 mutable LyXFont font_;