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(std::ostream &) const;
58 void read(LyXLex & lex);
60 int latex(std::ostream &,
61 bool fragile, bool free_spc) const;
63 int ascii(std::ostream &, int linelen) const;
65 int linuxdoc(std::ostream &) const;
67 int docBook(std::ostream &) const;
70 Inset * clone(Buffer const &, bool same_id = false) const;
72 void validate(LaTeXFeatures & features) const;
74 Inset::Code lyxCode() const;
76 bool insetAllowed(Inset::Code code) const;
78 virtual RESULT localDispatch(BufferView *, kb_action, string const &);
80 std::vector<string> const getLabelList() const;
82 void handleExtern(string const & arg, BufferView * bv);
84 MathInset const * par() const;
90 MathInsetTypes getType() const;
92 /// Safe setting of contents
93 void par(MathMatrixInset *);
95 MathMatrixInset * par_;