]> git.lyx.org Git - lyx.git/blob - src/mathed/MathMacroTemplate.h
make it compile again (hopefully)
[lyx.git] / src / mathed / MathMacroTemplate.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 "MathData.h"
17 #include "MathMacroTable.h"
18 #include "InsetMathNest.h"
19
20 #include "support/types.h"
21
22 /// This class contains the macro definition.
23 class MathMacroTemplate : public InsetMathNest {
24 public:
25         ///
26         MathMacroTemplate();
27         ///
28         MathMacroTemplate(std::string const & name, int nargs,
29                 std::string const & type,
30                 MathArray const & = MathArray(),
31                 MathArray const & = MathArray());
32         ///
33         explicit MathMacroTemplate(std::istream & is);
34         ///
35         void edit(LCursor & cur, bool left);
36         ///
37         EDITABLE editable() const { return HIGHLY_EDITABLE; }
38         ///
39         void read(Buffer const &, LyXLex & lex);
40         ///
41         void write(Buffer const &, std::ostream & os) const;
42         ///
43         void write(WriteStream & os) const;
44         /// Number of arguments
45         int numargs() const;
46         ///
47         void numargs(int);
48         ///
49         std::string name() const;
50         ///
51         MacroData asMacroData() const;
52         ///
53         void draw(PainterInfo & pi, int x, int y) const;
54         ///
55         void metrics(MetricsInfo & mi, Dimension & dim) const;
56         /// identifies macro templates
57         MathMacroTemplate * asMacroTemplate() { return this; }
58         /// identifies macro templates
59         MathMacroTemplate const * asMacroTemplate() const { return this; }
60         ///
61         InsetBase::Code lyxCode() const { return MATHMACRO_CODE; }
62
63 private:
64         virtual std::auto_ptr<InsetBase> doClone() const;
65         /// prefix in inset
66         lyx::docstring prefix() const;
67
68         ///
69         int numargs_;
70         ///
71         std::string name_;
72         /// newcommand or renewcommand or def
73         std::string type_;
74 };
75
76 #endif