]> git.lyx.org Git - lyx.git/blob - src/mathed/formula.h
more IU
[lyx.git] / src / mathed / formula.h
1 // -*- C++ -*-
2 /**
3  * \file formula.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Alejandro Aguilar Sierra
8  * \author André Pönitz
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #if 0
14 #ifndef INSET_FORMULA_H
15 #define INSET_FORMULA_H
16
17 #include "formulabase.h"
18 #include "math_atom.h"
19
20 #include <boost/scoped_ptr.hpp>
21
22 class RenderPreview;
23
24
25 /// The main LyX math inset
26 class InsetFormula : public InsetFormulaBase {
27 public:
28         ///
29         InsetFormula();
30         ///
31         explicit InsetFormula(std::string const & data);
32         ///
33         InsetFormula(InsetFormula const &);
34         ///
35         ~InsetFormula();
36         ///
37         void metrics(MetricsInfo & mi, Dimension & dim) const;
38         ///
39         void draw(PainterInfo & pi, int x, int y) const;
40
41         ///
42         void write(Buffer const &, std::ostream &) const;
43         ///
44         void read(Buffer const &, LyXLex & lex);
45         ///
46         int latex(Buffer const &, std::ostream &,
47                   OutputParams const &) const;
48         ///
49         int plaintext(Buffer const &, std::ostream &,
50                   OutputParams const &) const;
51         ///
52         int linuxdoc(Buffer const &, std::ostream &,
53                      OutputParams const &) const;
54         ///
55         int docbook(Buffer const &, std::ostream &,
56                     OutputParams const &) const;
57
58         ///
59         virtual std::auto_ptr<InsetBase> clone() const;
60         ///
61         void validate(LaTeXFeatures & features) const;
62         ///
63         InsetOld::Code lyxCode() const;
64         ///
65         bool insetAllowed(InsetOld::Code code) const;
66         /// Appends \c list with all labels found within this inset.
67         void getLabelList(Buffer const &,
68                           std::vector<std::string> & list) const;
69         ///
70         MathAtom const & par() const { return par_; }
71         ///
72         MathAtom & par() { return par_; }
73         ///
74         void generatePreview(Buffer const &) const;
75         ///
76         void addPreview(lyx::graphics::PreviewLoader &) const;
77         ///
78         void mutate(std::string const & type);
79
80 private:
81         /// Slot receiving a signal that the preview is ready to display.
82         void statusChanged() const;
83         /// available in AMS only?
84         bool ams() const;
85
86         /// contents
87         MathAtom par_;
88
89         /// The pointer never changes although *preview_'s contents may.
90         boost::scoped_ptr<RenderPreview> const preview_;
91 };
92 #endif
93 #endif