]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macro.h
a1637a7607de4447a88cadbccd060dfc72c12128
[lyx.git] / src / mathed / math_macro.h
1 // -*- C++ -*-
2 /**
3  * \file math_macro.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 "math_nestinset.h"
17 #include "math_data.h"
18
19
20 /// This class contains the data for a macro.
21 class MathMacro : public MathDimInset {
22 public:
23         /// A macro can be built from an existing template
24         explicit MathMacro(std::string const &);
25         ///
26         std::auto_ptr<InsetBase> clone() const;
27         ///
28         MathMacro * asMacro() { return this; }
29         ///
30         MathMacro const * asMacro() const { return this; }
31         ///
32         void draw(PainterInfo & pi, int x, int y) const;
33         ///
34         void drawExpanded(PainterInfo & pi, int x, int y) const;
35         ///
36         void metrics(MetricsInfo & mi, Dimension & dim) const;
37         ///
38         void metricsExpanded(MetricsInfo & mi, Dimension & dim) const;
39         ///
40         int widthExpanded() const;
41         ///
42         std::string name() const;
43         ///
44         void setExpansion(MathArray const & exp, MathArray const & args) const;
45
46         ///
47         void validate(LaTeXFeatures &) const;
48
49         ///
50         void maple(MapleStream &) const;
51         ///
52         void mathmlize(MathMLStream &) const;
53         ///
54         void octave(OctaveStream &) const;
55         ///
56         void infoize(std::ostream &) const;
57         ///
58         void infoize2(std::ostream &) const;
59
60 private:
61         ///
62         void updateExpansion() const;
63
64         ///
65         std::string name_;
66         ///
67         mutable MathArray expanded_;
68         ///
69         mutable MathArray args_;
70 };
71
72
73 #endif