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
24 #include "mathed/formulabase.h"
25 #include "math_defs.h"
27 class MathMatrixInset;
30 class InsetFormula : public InsetFormulaBase {
35 InsetFormula(InsetFormula const &);
37 explicit InsetFormula(MathInsetTypes);
39 explicit InsetFormula(string const &);
43 void operator=(InsetFormula const &);
45 int ascent(BufferView *, LyXFont const &) const;
47 int descent(BufferView *, LyXFont const &) const;
49 int width(BufferView *, LyXFont const &) const;
51 void draw(BufferView *, LyXFont const &, int, float &, bool) const;
56 void write(Buffer const *, std::ostream &) const;
58 void read(Buffer const *, LyXLex & lex);
60 int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
62 int ascii(Buffer const *, std::ostream &, int linelen) const;
64 int linuxdoc(Buffer const *, std::ostream &) const;
66 int docbook(Buffer const *, std::ostream &) const;
69 Inset * clone(Buffer const &, bool same_id = false) const;
71 void validate(LaTeXFeatures & features) const;
73 Inset::Code lyxCode() const;
75 bool insetAllowed(Inset::Code code) const;
77 virtual RESULT localDispatch(BufferView *, kb_action, string const &);
79 std::vector<string> const getLabelList() const;
81 void handleExtern(string const & arg, BufferView * bv);
83 MathInset const * par() const;
89 MathInsetTypes getType() const;
91 /// Safe setting of contents
92 void par(MathMatrixInset *);
94 MathMatrixInset * par_;