]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathMBox.h
MathML for MathBox and such.
[lyx.git] / src / mathed / InsetMathMBox.h
1 // -*- C++ -*-
2 /**
3  * \file InsetMathMBox.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #define MATH_MBOX
13
14 #ifdef MATH_MBOX
15
16 #ifndef MATH_MBOXINSET_H
17 #define MATH_MBOXINSET_H
18
19 #include "InsetMath.h"
20
21 #include "insets/InsetText.h"
22
23
24 namespace lyx {
25
26 class Buffer;
27 class BufferView;
28
29 // almost a substitute for the real text inset...
30
31 class InsetMathMBox : public InsetMath {
32 public:
33         ///
34         explicit InsetMathMBox(Buffer * buffer);
35         explicit InsetMathMBox(Buffer * buffer, Layout const & layout);
36
37         /// this stores metrics information in cache_
38         void metrics(MetricsInfo & mi, Dimension & dim) const;
39         /// draw according to cached metrics
40         void draw(PainterInfo &, int x, int y) const;
41         ///
42         bool inMathed() const { return false; }
43         ///
44         bool isActive() const { return true; }
45
46         ///
47         void write(WriteStream & os) const;
48         ///
49         int latex(odocstream & os, OutputParams const & runparams) const;
50         ///
51         Text * getText(int) const;
52         ///
53         void cursorPos(BufferView const & bv, CursorSlice const & sl,
54                 bool boundary, int & x, int & y) const;
55         ///
56         InsetCode lyxCode() const { return MATH_MBOX_CODE; }
57
58 protected:
59         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
60
61         ///
62         mutable InsetText text_;
63
64 private:
65         virtual Inset * clone() const;
66 };
67
68
69
70 } // namespace lyx
71
72 #endif //MATH_MBOXINSET_H
73
74 #endif //MATH_MBOX