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 plaintext(Buffer const &, std::ostream &,
44 OutputParams const &) const;
46 int latex(Buffer const &, std::ostream & os,
47 OutputParams const &) const;
49 int linuxdoc(Buffer const &, std::ostream & os,
50 OutputParams const &) const;
52 int docbook(Buffer const &, std::ostream &,
53 OutputParams const &) const;
56 virtual std::auto_ptr<InsetBase> clone() const;
58 InsetOld::Code lyxCode() const;
60 MathAtom const & par() const;
65 void read(std::istream & is);
67 std::string prefix() const;