]> git.lyx.org Git - features.git/blob - src/mathed/math_macrotemplate.h
more mathed cleanup
[features.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 private:
46     ///
47     short flags;
48     ///
49     MathedTextCodes tcode;
50     ///
51     std::vector<MathMacroArgument> args_;
52     ///
53     int nargs;
54     ///
55     friend class MathMacro;
56 };
57 #endif