]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macro.h
fix reading the author field.
[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 #include "math_nestinset.h"
19 #include "math_macrotable.h"
20
21
22 /// This class contains the data for a macro.
23 class MathMacro : public MathNestInset {
24 public:
25         /// A macro can be built from an existing template
26         MathMacro(std::string const & name, int numargs);
27         ///
28         std::auto_ptr<InsetBase> clone() const;
29         ///
30         void draw(PainterInfo & pi, int x, int y) const;
31         ///
32         void drawExpanded(PainterInfo & pi, int x, int y) const;
33         ///
34         void metrics(MetricsInfo & mi, Dimension & dim) const;
35         ///
36         std::string name() const;
37         ///
38         void setExpansion(MathArray const & exp, MathArray const & args) const;
39
40         ///
41         void validate(LaTeXFeatures &) const;
42
43         ///
44         void maple(MapleStream &) const;
45         ///
46         void mathmlize(MathMLStream &) const;
47         ///
48         void octave(OctaveStream &) const;
49         ///
50         void infoize(std::ostream &) const;
51         ///
52         void infoize2(std::ostream &) const;
53
54 private:
55         ///
56         void updateExpansion() const;
57         ///
58         void expand() const;
59
60         /// name of macro
61         std::string name_;
62         /// the unexpanded macro defintition
63         mutable MathArray tmpl_;
64         /// the matcro substituted with our args
65         mutable MathArray expanded_;
66 };
67
68
69 #endif