]> git.lyx.org Git - features.git/blob - src/mathed/math_macrotemplate.h
Replace LString.h with support/std_string.h,
[features.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_nestinset.h"
17 #include "support/std_string.h"
18
19
20 class MathMacro;
21
22 //class MathMacroTemplate : public MathInset, boost::noncopyable
23
24 /// This class contains the macro definition.
25 class MathMacroTemplate : public MathNestInset {
26 public:
27         ///
28         MathMacroTemplate();
29         ///
30         MathMacroTemplate(string const & name, int nargs, string const & type,
31                 MathArray const & = MathArray(), MathArray const & = MathArray());
32         ///
33         explicit MathMacroTemplate(std::istream & is);
34         ///
35         virtual std::auto_ptr<InsetBase> clone() const;
36         ///
37         void write(WriteStream & os) const;
38         /// Number of arguments
39         int numargs() const;
40         ///
41         void numargs(int);
42         ///
43         string name() const;
44         ///
45         void draw(PainterInfo &, int x, int y) const;
46         ///
47         void metrics(MetricsInfo & mi, Dimension & dim) const;
48         /// identifies macro templates
49         MathMacroTemplate * asMacroTemplate() { return this; }
50         /// identifies macro templates
51         MathMacroTemplate const * asMacroTemplate() const { return this; }
52 private:
53         ///
54         int numargs_;
55         ///
56         string name_;
57         /// newcommand or renewcommand or def
58         string type_;
59 };
60
61 #endif