]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotemplate.h
Applied Angus patch to compile on DEC C++ and to avoid name clashes
[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 //#include <boost/smart_ptr.hpp>
9
10 #include "math_parinset.h"
11 #include "math_macroarg.h"
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 class MathMacro;
18
19 /** This class contains the macro definition
20     \author Alejandro Aguilar Sierra
21  */
22 class MathMacroTemplate : public MathParInset, public boost::noncopyable {
23 public:
24         friend class MathMacro;
25         
26         /// A template constructor needs all the data
27         explicit
28         MathMacroTemplate(string const &, int na);
29         ///
30         void draw(Painter &, int, int);
31         ///
32         void Metrics();
33         ///
34         void WriteDef(std::ostream &, bool fragile);
35         /// useful for special insets
36         void setTCode(MathedTextCodes t);
37         ///
38         MathedTextCodes getTCode() const;
39         /// Number of arguments
40         int getNoArgs() const;
41         ///
42         void GetMacroXY(int, int &, int &) const;
43         ///
44         MathParInset * getMacroPar(int) const;
45         ///
46         void setMacroPar(int, MathedArray const &);
47         ///
48         void SetMacroFocus(int &, int, int);
49         ///
50         void setEditMode(bool);
51 private:
52         /// Are we in edit mode or not?
53         bool edit_;
54         ///
55         MathedTextCodes tcode_;
56         ///
57         //std::vector<boost::shared_ptr<MathMacroArgument> > args_;
58         std::vector<MathMacroArgument> args_;
59         ///
60         int nargs_;
61 };
62 #endif