]> git.lyx.org Git - lyx.git/blob - src/mathed/math_textinset.h
introduce namespace lyx::support
[lyx.git] / src / mathed / math_textinset.h
1 #ifndef MATH_TEXTINSET_H
2 #define MATH_TEXTINSET_H
3
4 #include "math_gridinset.h"
5
6
7 // not yet a substitute for the real text inset...
8
9 class MathTextInset : public MathNestInset {
10 public:
11         ///
12         MathTextInset();
13         ///
14         InsetBase * clone() const;
15         /// get cursor position
16         void getPos(idx_type idx, pos_type pos, int & x, int & y) const;
17         /// this stores metrics information in cache_
18         void metrics(MetricsInfo & mi, Dimension & dim) const;
19         /// draw according to cached metrics
20         void draw(PainterInfo &, int x, int y) const;
21         /// draw selection background
22         void drawSelection(PainterInfo & pi,
23                 idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const;
24         /// moves cursor up or down
25         bool idxUpDown2(idx_type &, pos_type & pos, bool up, int targetx) const;
26 protected:
27         /// row corresponding to given position
28         idx_type pos2row(pos_type pos) const;
29         /// cached metrics
30         mutable MathGridInset cache_;
31 };
32
33 #endif