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_H
18 #define INSET_FORMULA_H
25 #include "mathed/formulabase.h"
26 #include "math_defs.h"
28 class MathMatrixInset;
31 class InsetFormula : public InsetFormulaBase {
36 explicit InsetFormula(MathInsetTypes);
38 explicit InsetFormula(string const &);
40 int ascent(BufferView *, LyXFont const &) const;
42 int descent(BufferView *, LyXFont const &) const;
44 int width(BufferView *, LyXFont const &) const;
46 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
49 void write(std::ostream &) const;
51 void read(LyXLex & lex);
53 int latex(std::ostream &,
54 bool fragile, bool free_spc) const;
56 int ascii(std::ostream &, int linelen) const;
58 int linuxdoc(std::ostream &) const;
60 int docBook(std::ostream &) const;
63 Inset * clone(Buffer const &, bool same_id = false) const;
65 void validate(LaTeXFeatures & features) const;
67 Inset::Code lyxCode() const;
69 virtual RESULT localDispatch(BufferView *, kb_action, string const &);
71 std::vector<string> const getLabelList() const;
73 void handleExtern(string const & arg, BufferView * bv);
75 MathMatrixInset * par() const;
81 /// Safe setting of contents
82 void par(MathInset *);