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