]> git.lyx.org Git - lyx.git/blob - src/mathed/formulamacro.h
Add In nsetOld * argument to updateInset to rebreak the correct par.
[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(string const & name, int nargs, string const & t);
31         /// constructs a mocro from its LaTeX definition
32         explicit InsetFormulaMacro(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 ascii(Buffer const *, std::ostream &, int linelen) const;
44         ///
45         int latex(Buffer const *, std::ostream & os,
46                   LatexRunParams const &) const;
47         ///
48         int linuxdoc(Buffer const *, std::ostream & os) const;
49         ///
50         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
51
52         ///
53         virtual std::auto_ptr<InsetBase> clone() const;
54         ///
55         InsetOld::Code lyxCode() const;
56         ///
57         MathAtom const & par() const;
58         ///
59         MathAtom & par();
60 private:
61         ///
62         void read(std::istream & is);
63         /// prefix in inset
64         string prefix() const;
65 };
66
67 #endif