3 * \file InsetFormulaMacro.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Alejandro Aguilar Sierra
10 * Full author contact details are available in file CREDITS.
13 #ifndef INSET_FORMULA_MACRO_H
14 #define INSET_FORMULA_MACRO_H
16 #include "InsetMathNest.h"
21 class MathMacroTemplate
;
25 // An InsetFormulaMacro only knows its name and asks the global
26 // MathMacroTable if it needs to know more.
28 /// Main LyX Inset for defining math macros
29 class InsetFormulaMacro
: public InsetMathNest
{
33 /// construct a macro hull from its name and the number of arguments
34 InsetFormulaMacro(docstring
const & name
, int nargs
, docstring
const & t
);
35 /// constructs a mocro from its LaTeX definition
36 explicit InsetFormulaMacro(docstring
const & s
);
38 void metrics(MetricsInfo
& mi
, Dimension
& dim
) const;
40 void draw(PainterInfo
& pi
, int x
, int y
) const;
43 void read(Lexer
& lex
);
45 void write(std::ostream
& os
) const;
47 int latex(odocstream
& os
, OutputParams
const &) const;
49 int plaintext(odocstream
&, OutputParams
const &) const;
51 int docbook(odocstream
&, OutputParams
const &) const;
54 InsetCode
lyxCode() const { return MATHMACRO_CODE_CODE
; }
56 docstring
const & getInsetName() const { return name_
; }
58 bool editable() const { return true; }
60 InsetCode
lyxCode() const { return MATH_FORMULA_MACRO_CODE
; }
63 MathAtom
& tmpl() const;
65 void read(std::istream
& is
);
67 docstring
prefix() const;
71 Inset
* clone() const;