]> git.lyx.org Git - lyx.git/blob - src/mathed/math_textinset.h
a step towards world domination^H^H^H
[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 // not yet a substitute for the real text inset...
7
8 class MathTextInset : public MathNestInset {
9 public:
10         ///
11         MathTextInset();
12         ///
13         MathInset * clone() const;
14         /// get cursor position
15         void getPos(idx_type idx, pos_type pos, int & x, int & y) const;
16         /// this stores metrics information in cache_
17         void metrics(MathMetricsInfo & mi) const;
18         /// draw according to cached metrics
19         void draw(MathPainterInfo &, int x, int y) const;
20         /// draw selection background
21         void drawSelection(MathPainterInfo & pi,
22                 idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const;
23         /// moves cursor up or down
24         bool idxUpDown(idx_type &, pos_type & pos, bool up, int targetx) const;
25 protected:
26         /// row corresponding to given position 
27         idx_type pos2row(pos_type pos) const;
28         /// cached metrics
29         mutable MathGridInset cache_;
30 };
31
32 #endif