3 * \file InsetMathMacro.h
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 "InsetMathNest.h"
18 #include "InsetMathNest.h"
19 #include "MathMacroTable.h"
22 /// This class contains the data for a macro.
23 class MathMacro : public InsetMathNest {
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;
31 /// draw selection background
32 void drawSelection(PainterInfo & pi, int x, int y) const;
34 void metrics(MetricsInfo & mi, Dimension & dim) const;
35 /// get cursor position
36 void cursorPos(BufferView const & bv, CursorSlice const & sl,
37 bool boundary, int & x, int & y) const;
39 InsetBase * editXY(LCursor & cur, int x, int y);
41 std::string name() const;
43 void setExpansion(MathArray const & exp, MathArray const & args) const;
46 void validate(LaTeXFeatures &) const;
49 void maple(MapleStream &) const;
51 void mathmlize(MathMLStream &) const;
53 void octave(OctaveStream &) const;
55 void infoize(std::ostream &) const;
57 void infoize2(std::ostream &) const;
60 virtual std::auto_ptr<InsetBase> doClone() const;
62 void updateExpansion() const;
68 /// the unexpanded macro defintition
69 mutable MathArray tmpl_;
70 /// the macro substituted with our args
71 mutable MathArray expanded_;