4 * Purpose: Declaration of formula inset
5 * Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
6 * Created: January 1996
7 * Description: Allows the edition of math paragraphs inside Lyx.
9 * Copyright: 1996, Alejandro Aguilar Sierra
11 * Version: 0.4, Lyx project.
13 * You are free to use and modify this code under the terms of
14 * the GNU General Public Licence version 2 or later.
17 #ifndef INSET_FORMULA_MACRO_H
18 #define INSET_FORMULA_MACRO_H
20 #include "formulabase.h"
26 class MathMacroTemplate;
28 // InsetFormulaMacro's only knows its name and asks the global
29 // MathMacroTable if it needs to know more.
32 class InsetFormulaMacro: public InsetFormulaBase {
36 /// construct a macro hull from its name and the number of arguments
37 explicit InsetFormulaMacro(string name, int na);
38 /// constructs a mocro from its LaTeX definition
39 explicit InsetFormulaMacro(string const & s);
41 int ascent(BufferView *, LyXFont const &) const;
43 int descent(BufferView *, LyXFont const &) const;
45 int width(BufferView *, LyXFont const &) const;
47 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
50 void read(Buffer const *, LyXLex & lex);
52 void write(Buffer const *, std::ostream & os) const;
54 int ascii(Buffer const *, std::ostream &, int linelen) const;
56 int latex(Buffer const *, std::ostream & os, bool fragile, bool free_spc) const;
58 int linuxdoc(Buffer const *, std::ostream & os) const;
60 int docbook(Buffer const *, std::ostream &) const;
63 Inset * clone(Buffer const &, bool same_id = false) const;
65 Inset::Code lyxCode() const;
67 RESULT localDispatch(BufferView *, kb_action, string const &);
69 MathInsetTypes getType() const;
71 MathAtom const & par() const;
76 string prefix() const;