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