]> git.lyx.org Git - lyx.git/blob - src/mathed/formula.h
further code uglification to make Jean-Marc's compiler happy
[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         InsetFormula(InsetFormula const &);
36         ///
37         explicit InsetFormula(MathInsetTypes);
38         ///
39         explicit InsetFormula(string const &);
40         ///
41         ~InsetFormula();
42         ///
43         void operator=(InsetFormula const &);
44         ///
45         int ascent(BufferView *, LyXFont const &) const;
46         ///
47         int descent(BufferView *, LyXFont const &) const;
48         ///
49         int width(BufferView *, LyXFont const &) const;
50         ///
51         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
52         ///
53         void metrics() const;
54
55         ///
56         void write(Buffer const *, std::ostream &) const;
57         ///
58         void read(Buffer const *, LyXLex & lex);
59         ///
60         int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
61         ///
62         int ascii(Buffer const *, std::ostream &, int linelen) const;
63         ///
64         int linuxdoc(Buffer const *, std::ostream &) const;
65         ///
66         int docbook(Buffer const *, std::ostream &) const;
67
68         ///
69         Inset * clone(Buffer const &, bool same_id = false) const;
70         ///
71         void validate(LaTeXFeatures & features) const;
72         ///
73         Inset::Code lyxCode() const;
74         ///
75         bool insetAllowed(Inset::Code code) const;
76         ///
77         virtual RESULT localDispatch(BufferView *, kb_action, string const &);
78         ///
79         std::vector<string> const getLabelList() const;
80         ///
81         void handleExtern(string const & arg, BufferView * bv);
82         ///
83         MathInset const * par() const;
84         ///
85         bool display() const;
86         ///
87         bool ams() const;
88         ///
89         MathInsetTypes getType() const;
90 private:
91         /// Safe setting of contents
92         void par(MathMatrixInset *);
93         ///
94         MathMatrixInset * par_;
95 };
96 #endif