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 "formulabase.h"
19 class MathMacroTemplate;
21 // An InsetFormulaMacro only knows its name and asks the global
22 // MathMacroTable if it needs to know more.
24 /// Main LyX Inset for defining math macros
25 class InsetFormulaMacro : public InsetFormulaBase {
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);
34 void metrics(MetricsInfo & mi, Dimension & dim) const;
36 void draw(PainterInfo & pi, int x, int y) const;
39 void read(Buffer const &, LyXLex & lex);
41 void write(Buffer const &, std::ostream & os) const;
43 int ascii(Buffer const &, std::ostream &, int linelen) const;
45 int latex(Buffer const &, std::ostream & os,
46 LatexRunParams const &) const;
48 int linuxdoc(Buffer const &, std::ostream & os) const;
50 int docbook(Buffer const &, std::ostream &, bool mixcont) const;
53 virtual std::auto_ptr<InsetBase> clone() const;
55 InsetOld::Code lyxCode() const;
57 MathAtom const & par() const;
62 void read(std::istream & is);
64 std::string prefix() const;