]> git.lyx.org Git - features.git/blob - src/mathed/InsetMathMBox.h
3581efa495ea7293c4b9c933eaf6835ffffa2690
[features.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 #ifndef MATH_MBOXINSET_H
13 #define MATH_MBOXINSET_H
14
15 #include "InsetMathDim.h"
16 #include "lyxtext.h"
17
18
19 namespace lyx {
20
21 class Buffer;
22 class BufferView;
23
24 // almost a substitute for the real text inset...
25
26 class InsetMathMBox : public InsetMathDim {
27 public:
28         ///
29         explicit InsetMathMBox(LyXLayout_ptr const & layout);
30         /// this stores metrics information in cache_
31         bool metrics(MetricsInfo & mi, Dimension & dim) const;
32         /// draw according to cached metrics
33         void draw(PainterInfo &, int x, int y) const;
34         ///
35         void drawSelection(PainterInfo & pi, int x, int y) const;
36         ///
37         bool inMathed() const { return false; }
38         ///
39         bool isActive() const { return true; }
40
41         ///
42         void write(Buffer const & buf, WriteStream & os) const;
43         ///
44         int latex(Buffer const &, odocstream & os,
45                         OutputParams const & runparams) const;
46         ///
47         LyXText * getText(int) const;
48         ///
49         void cursorPos(BufferView const & bv, CursorSlice const & sl,
50                 bool boundary, int & x, int & y) const;
51 protected:
52         virtual void doDispatch(LCursor & cur, FuncRequest & cmd);
53
54         ///
55         mutable LyXText text_;
56
57 private:
58         virtual std::auto_ptr<InsetBase> doClone() const;
59 };
60
61
62
63 } // namespace lyx
64 #endif