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 "formulabase.h"
25 #include "math_defs.h"
26 #include "math_atom.h"
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(Buffer const *, std::ostream &) const;
51 void read(Buffer const *, LyXLex & lex);
53 int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
55 int ascii(Buffer const *, std::ostream &, int linelen) const;
57 int linuxdoc(Buffer const *, std::ostream &) const;
59 int docbook(Buffer const *, std::ostream &) const;
62 Inset * clone(Buffer const &, bool same_id = false) const;
64 void validate(LaTeXFeatures & features) const;
66 Inset::Code lyxCode() const;
68 bool insetAllowed(Inset::Code code) const;
70 virtual RESULT localDispatch(BufferView *, kb_action, string const &);
72 std::vector<string> const getLabelList() const;
74 MathInsetTypes getType() const;
76 MathAtom const & par() const { return par_; }
78 MathAtom & par() { return par_; }
81 /// Is this a displayed environment?
83 /// available in AMS only?
86 MathHullInset * hull();
88 MathHullInset const * hull() const;
90 void handleExtern(string const & arg);