]> git.lyx.org Git - lyx.git/blob - src/mathed/formula.h
cloase a leak; remove a few casts; cosmetics
[lyx.git] / src / mathed / formula.h
1 // -*- C++ -*-
2 /*
3  *  File:        formula.h
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. 
8  *
9  *  Copyright: 1996, Alejandro Aguilar Sierra
10  *
11  *  Version: 0.4, Lyx project.
12  *
13  *   You are free to use and modify this code under the terms of
14  *   the GNU General Public Licence version 2 or later.
15  */
16
17 #ifndef INSET_FORMULA_H 
18 #define INSET_FORMULA_H
19
20 #ifdef __GNUG__
21 #pragma interface
22 #endif
23
24 #include "mathed/formulabase.h"
25 #include "math_defs.h"
26
27 class MathMatrixInset;
28
29 ///
30 class InsetFormula : public InsetFormulaBase {
31 public:
32         ///
33         InsetFormula();
34         ///
35         explicit InsetFormula(MathInsetTypes);
36         ///
37         explicit InsetFormula(string const &);
38         ///
39         ~InsetFormula();
40         ///
41         int ascent(BufferView *, LyXFont const &) const;
42         ///
43         int descent(BufferView *, LyXFont const &) const;
44         ///
45         int width(BufferView *, LyXFont const &) const;
46         ///
47         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
48         ///
49         void metrics() const;
50
51         ///
52         void write(std::ostream &) const;
53         ///
54         void read(LyXLex & lex);
55         ///
56         int latex(std::ostream &,
57                   bool fragile, bool free_spc) const;
58         ///
59         int ascii(std::ostream &, int linelen) const;
60         ///
61         int linuxdoc(std::ostream &) const;
62         ///
63         int docBook(std::ostream &) const;
64
65         ///
66         Inset * clone(Buffer const &, bool same_id = false) const;
67         ///
68         void validate(LaTeXFeatures & features) const;
69         ///
70         Inset::Code lyxCode() const;
71         ///
72         bool insetAllowed(Inset::Code code) const;
73         ///
74         virtual RESULT localDispatch(BufferView *, kb_action, string const &);
75         ///
76         std::vector<string> const getLabelList() const;
77         ///
78         void handleExtern(string const & arg, BufferView * bv);
79         ///
80         MathInset * par() const;
81         ///
82         bool display() const;
83         ///
84         bool ams() const;
85         ///
86         MathInsetTypes getType() const;
87 private:
88         /// Safe setting of contents
89         void par(MathMatrixInset *);
90         ///
91         MathMatrixInset * par_;
92 };
93 #endif