]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotemplate.h
179f4da10a3919721d73e3692214ee79b31ac136
[lyx.git] / src / mathed / math_macrotemplate.h
1 // -*- C++ -*-
2 #ifndef MATHMACROTEMPLATE
3 #define MATHMACROTEMPLATE
4
5 #include <vector>
6
7 #include "math_parinset.h"
8 #include "math_macroarg.h"
9
10 class MathMacro;
11
12 /// This class contains the macro definition
13 class MathMacroTemplate : public MathParInset {
14 public:
15         /// A template constructor needs all the data
16         explicit
17         MathMacroTemplate(string const &, int na = 0, int f = 0);
18         ///
19         ~MathMacroTemplate();
20         ///
21         void draw(Painter &, int, int);
22         ///
23         void Metrics();
24         ///
25         void WriteDef(std::ostream &, bool fragile);
26         /// useful for special insets
27         void  setTCode(MathedTextCodes t);
28         ///
29         MathedTextCodes getTCode() const;
30         /// 
31         void setArgument(MathedArray *, int i= 0);
32         /// Number of arguments
33         int getNoArgs() const;
34         ///
35         void GetMacroXY(int, int &, int &) const;
36         ///
37         MathParInset * getMacroPar(int) const;
38         ///
39         void SetMacroFocus(int &, int, int);
40         ///
41         void setEditMode(bool);
42         
43         /// Replace the appropriate arguments with a specific macro's data
44         void update(MathMacro * m = 0);
45         ///
46         short flags() const {
47                 return flags_;
48         }
49 private:
50         ///
51         short flags_;
52         ///
53         MathedTextCodes tcode_;
54         ///
55         std::vector<MathMacroArgument> args_;
56         ///
57         int nargs_;
58 };
59 #endif