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"
25 /// This class contains the data for a macro.
26 class MathMacro : public InsetMathNest {
28 /// A macro can be built from an existing template
29 MathMacro(docstring const & name, int numargs);
31 void draw(PainterInfo & pi, int x, int y) const;
33 void drawExpanded(PainterInfo & pi, int x, int y) const;
34 /// draw selection background
35 void drawSelection(PainterInfo & pi, int x, int y) const;
37 void metrics(MetricsInfo & mi, Dimension & dim) const;
38 /// get cursor position
39 void cursorPos(BufferView const & bv, CursorSlice const & sl,
40 bool boundary, int & x, int & y) const;
42 InsetBase * editXY(LCursor & cur, int x, int y);
44 docstring name() const;
46 void setExpansion(MathArray const & exp, MathArray const & args) const;
49 void validate(LaTeXFeatures &) const;
52 void maple(MapleStream &) const;
54 void mathmlize(MathStream &) const;
56 void octave(OctaveStream &) const;
58 void infoize(odocstream &) const;
60 void infoize2(odocstream &) const;
63 virtual std::auto_ptr<InsetBase> doClone() const;
65 void updateExpansion() const;
71 /// the unexpanded macro defintition
72 mutable MathArray tmpl_;
73 /// the macro substituted with our args
74 mutable MathArray expanded_;