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; }
52 bool match(MathAtom const &) const { return false; }
55 void maple(MapleStream &) const;
57 void mathmlize(MathMLStream &) const;
59 void octave(OctaveStream &) const;
61 void infoize(std::ostream &) const;
63 void infoize2(std::ostream &) const;
67 void operator=(MathMacro const &);
69 std::string name() const;
71 bool defining() const;
73 void updateExpansion() const;
80 mutable MathArray expanded_;
82 mutable MetricsInfo mi_;
84 mutable LyXFont font_;