]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
more IU
[lyx.git] / src / mathed / formulamacro.h
1 // -*- C++ -*-
2 /**
3  * \file formulamacro.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 INSET_FORMULA_MACRO_H
14 #define INSET_FORMULA_MACRO_H
15
16 #include "formulabase.h"
17
18
19 class MathMacroTemplate;
20
21 // An InsetFormulaMacro only knows its name and asks the global
22 // MathMacroTable if it needs to know more.
23
24 /// Main LyX Inset for defining math macros
25 class InsetFormulaMacro : public InsetFormulaBase {
26 public:
27         ///
28         InsetFormulaMacro();
29         /// construct a macro hull from its name and the number of arguments
30         explicit InsetFormulaMacro(std::string const & name, int nargs, std::string const & t);
31         /// constructs a mocro from its LaTeX definition
32         explicit InsetFormulaMacro(std::string const & s);
33         ///
34         void metrics(MetricsInfo & mi, Dimension & dim) const;
35         ///
36         void draw(PainterInfo & pi, int x, int y) const;
37
38         ///
39         void read(Buffer const &, LyXLex & lex);
40         ///
41         void write(Buffer const &, std::ostream & os) const;
42         ///
43         int plaintext(Buffer const &, std::ostream &,
44                   OutputParams const &) const;
45         ///
46         int latex(Buffer const &, std::ostream & os,
47                   OutputParams const &) const;
48         ///
49         int linuxdoc(Buffer const &, std::ostream & os,
50                      OutputParams const &) const;
51         ///
52         int docbook(Buffer const &, std::ostream &,
53                     OutputParams const &) const;
54
55         ///
56         virtual std::auto_ptr<InsetBase> clone() const;
57         ///
58         InsetOld::Code lyxCode() const;
59         ///
60         MathAtom const & par() const;
61         ///
62         MathAtom & par();
63 private:
64         ///
65         void read(std::istream & is);
66         /// prefix in inset
67         std::string prefix() const;
68 };
69
70 #endif