]> git.lyx.org Git - lyx.git/blob - src/mathed/InsetMathMBox.h
simplify GuiToc / TocWidget interaction. Much can still be simplified...
[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 #include "Text.h"
21
22
23 namespace lyx {
24
25 class Buffer;
26 class BufferView;
27
28 // almost a substitute for the real text inset...
29
30 class InsetMathMBox : public InsetMath {
31 public:
32         ///
33         explicit InsetMathMBox();
34         explicit InsetMathMBox(LayoutPtr const & layout);
35
36         /// this stores metrics information in cache_
37         void metrics(MetricsInfo & mi, Dimension & dim) const;
38         /// draw according to cached metrics
39         void draw(PainterInfo &, int x, int y) const;
40         ///
41         bool inMathed() const { return false; }
42         ///
43         bool isActive() const { return true; }
44
45         ///
46         void write(Buffer const & buf, WriteStream & os) const;
47         ///
48         int latex(Buffer const &, odocstream & os,
49                         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 protected:
56         virtual void doDispatch(Cursor & cur, FuncRequest & cmd);
57
58         ///
59         mutable Text text_;
60
61 private:
62         virtual Inset * clone() const;
63 };
64
65
66
67 } // namespace lyx
68
69 #endif //MATH_MBOXINSET_H
70
71 #endif //MATH_MBOX