]> git.lyx.org Git - lyx.git/blob - src/mathed/formula.h
remove noload/don't typeset
[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 "formulabase.h"
25 #include "math_atom.h"
26
27 #include <boost/scoped_ptr.hpp>
28
29 ///
30 class InsetFormula : public InsetFormulaBase {
31 public:
32         ///
33         InsetFormula();
34         ///
35         explicit InsetFormula(BufferView *);
36         ///
37         explicit InsetFormula(const string & data);
38         ///
39         InsetFormula(InsetFormula const &);
40         ///
41         ~InsetFormula();
42         ///
43         int ascent(BufferView *, LyXFont const &) const;
44         ///
45         int descent(BufferView *, LyXFont const &) const;
46         ///
47         int width(BufferView *, LyXFont const &) const;
48         ///
49         void draw(BufferView *, LyXFont const &, int, float &, bool) const;
50
51         ///
52         void write(Buffer const *, std::ostream &) const;
53         ///
54         void read(Buffer const *, LyXLex & lex);
55         ///
56         int latex(Buffer const *, std::ostream &, bool fragile, bool free_spc) const;
57         ///
58         int ascii(Buffer const *, std::ostream &, int linelen) const;
59         ///
60         int linuxdoc(Buffer const *, std::ostream &) const;
61         ///
62         int docbook(Buffer const *, std::ostream &, bool mixcont) const;
63
64         ///
65         Inset * clone(Buffer const &, bool same_id = false) const;
66         ///
67         void validate(LaTeXFeatures & features) const;
68         ///
69         Inset::Code lyxCode() const;
70         ///
71         bool insetAllowed(Inset::Code code) const;
72         ///
73         std::vector<string> const getLabelList() const;
74         ///
75         MathAtom const & par() const { return par_; }
76         ///
77         MathAtom & par() { return par_; }
78         ///
79         void generatePreview() const;
80         ///
81         void addPreview(grfx::PreviewLoader &) const;
82         ///
83         //void mutate(string const & type);
84
85 private:
86         /// available in AMS only?
87         bool ams() const;
88
89         /// contents
90         MathAtom par_;
91
92         /// Use the Pimpl idiom to hide the internals of the previewer.
93         class PreviewImpl;
94         friend class PreviewImpl;
95         /// The pointer never changes although *preview_'s contents may.
96         boost::scoped_ptr<PreviewImpl> const preview_;
97 };
98 #endif