]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotemplate.h
small cleanup, doxygen, formatting changes
[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     \author Alejandro Aguilar Sierra
14  */
15 class MathMacroTemplate : public MathParInset {
16 public:
17         /// A template constructor needs all the data
18         explicit
19         MathMacroTemplate(string const &, int na = 0, int f = 0);
20         ///
21         ~MathMacroTemplate();
22         ///
23         void draw(Painter &, int, int);
24         ///
25         void Metrics();
26         ///
27         void WriteDef(std::ostream &, bool fragile);
28         /// useful for special insets
29         void  setTCode(MathedTextCodes t);
30         ///
31         MathedTextCodes getTCode() const;
32         /// 
33         void setArgument(MathedArray *, int i= 0);
34         /// Number of arguments
35         int getNoArgs() const;
36         ///
37         void GetMacroXY(int, int &, int &) const;
38         ///
39         MathParInset * getMacroPar(int) const;
40         ///
41         void SetMacroFocus(int &, int, int);
42         ///
43         void setEditMode(bool);
44         
45         /// Replace the appropriate arguments with a specific macro's data
46         void update(MathMacro * m = 0);
47         ///
48         short flags() const {
49                 return flags_;
50         }
51 private:
52         ///
53         short flags_;
54         ///
55         MathedTextCodes tcode_;
56         ///
57         std::vector<MathMacroArgument> args_;
58         ///
59         int nargs_;
60 };
61 #endif