]> git.lyx.org Git - features.git/blob - src/mathed/math_macro.h
remove a few unneeded 'include'
[features.git] / src / mathed / math_macro.h
1 // -*- C++ -*-
2 /*
3  *  File:        math_macro.h
4  *  Purpose:     Declaration of macro class for mathed
5  *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6  *  Created:     November 1996
7  *  Description: WYSIWYG math macros
8  *
9  *  Dependencies: Math
10  *
11  *  Copyright: 1996, 1997 Alejandro Aguilar Sierra
12  *
13  *   Version: 0.2, Math & Lyx project.
14  *
15  *   This code is under the GNU General Public Licence version 2 or later.
16  */
17 #ifndef MATH_MACRO_H
18 #define MATH_MACRO_H
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include "math_nestinset.h"
25 #include "math_metricsinfo.h"
26 #include "math_macroarg.h"
27 #include "LString.h"
28
29 class MathMacroTemplate;
30
31
32 /** This class contains the data for a macro
33     \author Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
34     \version November 1996
35  */
36 class MathMacro : public MathNestInset {
37 public:
38         /// A macro can be built from an existing template
39         explicit MathMacro(string const &);
40         ///
41         MathMacro(MathMacro const &);
42         ///
43         void draw(MathPainterInfo &, int x, int y) const;
44         ///
45         void metrics(MathMetricsInfo & st) const;
46         ///
47         MathInset * clone() const;
48         ///
49         void dump() const;
50
51         ///
52         bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
53         ///
54         bool idxLeft(idx_type & idx, pos_type & pos) const;
55         ///
56         bool idxRight(idx_type & idx, pos_type & pos) const;
57
58         ///
59         void validate(LaTeXFeatures &) const;
60         ///
61         bool isMacro() const { return true; }
62         ///
63         bool match(MathInset *) const { return false; }
64
65         ///
66         void normalize(NormalStream &) const;
67         ///
68         void maplize(MapleStream &) const;
69         ///
70         void mathmlize(MathMLStream &) const;
71         ///
72         void octavize(OctaveStream &) const;
73         ///
74         void write(WriteStream & os) const;
75
76 private:
77         ///
78         void operator=(MathMacro const &);
79         ///
80         string name() const;
81         ///
82         bool defining() const;
83         ///
84         void updateExpansion() const;
85         ///
86         void expand() const;
87
88         ///
89         MathAtom & tmplate_;
90         ///
91         mutable MathXArray expanded_;
92         ///
93         mutable MathMetricsInfo mi_;
94         ///
95         mutable LyXFont font_;
96 };
97
98
99 #endif