]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathMacro.h
make it compile again (hopefully)
[lyx.git] / src / mathed / InsetMathMacro.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathMacro.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATH_MACRO_H
14 #define MATH_MACRO_H
15
16 #include "InsetMathNest.h"
17 #include "MathData.h"
18 #include "InsetMathNest.h"
19 #include "MathMacroTable.h"
20
21
22 /// This class contains the data for a macro.
23 class MathMacro : public InsetMathNest {
24 public:
25         /// A macro can be built from an existing template
26         MathMacro(std::string const & name, int numargs);
27         ///
28         void draw(PainterInfo & pi, int x, int y) const;
29         ///
30         void drawExpanded(PainterInfo & pi, int x, int y) const;
31         /// draw selection background
32         void drawSelection(PainterInfo & pi, int x, int y) const;
33         ///
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;
38         ///
39         InsetBase * editXY(LCursor & cur, int x, int y);
40         ///
41         std::string name() const;
42         ///
43         void setExpansion(MathArray const & exp, MathArray const & args) const;
44
45         ///
46         void validate(LaTeXFeatures &) const;
47
48         ///
49         void maple(MapleStream &) const;
50         ///
51         void mathmlize(MathMLStream &) const;
52         ///
53         void octave(OctaveStream &) const;
54         ///
55         void infoize(std::ostream &) const;
56         ///
57         void infoize2(std::ostream &) const;
58
59 private:
60         virtual std::auto_ptr<InsetBase> doClone() const;
61         ///
62         void updateExpansion() const;
63         ///
64         void expand() const;
65
66         /// name of macro
67         std::string name_;
68         /// the unexpanded macro defintition
69         mutable MathArray tmpl_;
70         /// the macro substituted with our args
71         mutable MathArray expanded_;
72 };
73
74
75 #endif