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 ParInset is the ParInset of the macro definition
29 // which in turn is stored in the global MathMacroTable.
30 // No copying/updating needed anymore...
33 class InsetFormulaMacro: public InsetFormulaBase {
38 InsetFormulaMacro(InsetFormulaMacro const &);
40 explicit InsetFormulaMacro(string name, int na);
44 void operator=(InsetFormulaMacro const &);
46 int ascent(BufferView *, LyXFont const &) const;
48 int descent(BufferView *, LyXFont const &) const;
50 int width(BufferView *, LyXFont const &) const;
52 void draw(BufferView *,LyXFont const &, int, float &, bool) const;
55 void read(LyXLex & lex);
57 void write(std::ostream & os) const;
59 int ascii(std::ostream &, int linelen) const;
61 int latex(std::ostream & os, bool fragile, bool free_spc) const;
63 int linuxdoc(std::ostream & os) const;
65 int docBook(std::ostream &) const;
68 Inset * clone(Buffer const &, bool same_id = false) const;
70 Inset::Code lyxCode() const;
72 RESULT localDispatch(BufferView *, kb_action, string const &);
74 MathInsetTypes getType() const;
76 MathInset const * par() const;
81 MathMacroTemplate const & tmacro() const;
83 string prefix() const;
85 MathMacroTemplate const * tmacro_;