]> git.lyx.org Git - lyx.git/blob - src/mathed/math_macrotemplate.h
more IU
[lyx.git] / src / mathed / math_macrotemplate.h
1 // -*- C++ -*-
2 /**
3  * \file math_macrotemplate.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef MATH_MACROTEMPLATE_H
14 #define MATH_MACROTEMPLATE_H
15
16 #include "math_data.h"
17 #include "math_nestinset.h"
18
19 #include <string>
20
21
22 class MathMacro;
23
24
25 //class MathMacroTemplate : public MathInset, boost::noncopyable
26
27 /// This class contains the macro definition.
28 class MathMacroTemplate : public MathNestInset {
29 public:
30         ///
31         MathMacroTemplate();
32         ///
33         MathMacroTemplate(std::string const & name, int nargs, std::string const & type,
34                 MathArray const & = MathArray(), MathArray const & = MathArray());
35         ///
36         explicit MathMacroTemplate(std::istream & is);
37         ///
38         virtual std::auto_ptr<InsetBase> clone() const;
39         ///
40         void write(WriteStream & os) const;
41         /// Number of arguments
42         int numargs() const;
43         ///
44         void numargs(int);
45         ///
46         std::string name() const;
47         ///
48         void draw(PainterInfo &, int x, int y) const;
49         ///
50         void metrics(MetricsInfo & mi, Dimension & dim) const;
51         /// identifies macro templates
52         MathMacroTemplate * asMacroTemplate() { return this; }
53         /// identifies macro templates
54         MathMacroTemplate const * asMacroTemplate() const { return this; }
55 private:
56         ///
57         int numargs_;
58         ///
59         std::string name_;
60         /// newcommand or renewcommand or def
61         std::string type_;
62 };
63
64 #endif