]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
get rid of same_id from function signatures
[lyx.git] / src / mathed / formulamacro.h
1 // -*- C++ -*-
2
3 /*
4  *  Main LyX Inset for defining math macros
5  *
6  *  \author Alejandro Aguilar Sierra
7  *  \author André Pönitz
8  *
9  *  Full author contact details are available in file CREDITS
10  *
11  *  You are free to use and modify this code under the terms of
12  *  the GNU General Public Licence version 2 or later.
13  */
14
15 #ifndef INSET_FORMULA_MACRO_H
16 #define INSET_FORMULA_MACRO_H
17
18 #include "formulabase.h"
19
20
21 class MathMacroTemplate;
22
23 // An InsetFormulaMacro only knows its name and asks the global
24 // MathMacroTable if it needs to know more.
25
26 ///
27 class InsetFormulaMacro : public InsetFormulaBase {
28 public:
29         ///
30         InsetFormulaMacro();
31         /// construct a macro hull from its name and the number of arguments
32         explicit InsetFormulaMacro(string const & name, int nargs);
33         /// constructs a mocro from its LaTeX definition
34         explicit InsetFormulaMacro(string const & s);
35         ///
36         void dimension(BufferView *, LyXFont const &, Dimension &) const;
37         ///
38         void draw(BufferView *, LyXFont const &, int, float &) const;
39
40         ///
41         void read(Buffer const *, LyXLex & lex);
42         ///
43         void write(Buffer const *, std::ostream & os) const;
44         ///
45         int ascii(Buffer const *, std::ostream &, int linelen) const;
46         ///
47         int latex(Buffer const *, std::ostream & os,
48                   LatexRunParams const &) const;
49         ///
50         int linuxdoc(Buffer const *, std::ostream & os) const;
51         ///
52         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
53
54         ///
55         Inset * clone(Buffer const &) const;
56         ///
57         //Inset * clone(Buffer const &, bool same_id) const;
58         ///
59         Inset::Code lyxCode() const;
60         ///
61         MathAtom const & par() const;
62         ///
63         MathAtom & par();
64 private:
65         ///
66         void read(std::istream & is);
67         /// prefix in inset
68         string prefix() const;
69 };
70
71 #endif