2 #ifndef MATH_TEXTINSET_H
3 #define MATH_TEXTINSET_H
5 #include "math_gridinset.h"
8 // not yet a substitute for the real text inset...
10 class MathTextInset : public MathNestInset {
15 virtual std::auto_ptr<InsetBase> clone() const;
16 /// get cursor position
17 void getPos(idx_type idx, pos_type pos, int & x, int & y) const;
18 /// this stores metrics information in cache_
19 void metrics(MetricsInfo & mi, Dimension & dim) const;
20 /// draw according to cached metrics
21 void draw(PainterInfo &, int x, int y) const;
22 /// draw selection background
23 void drawSelection(PainterInfo & pi,
24 idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const;
25 /// moves cursor up or down
26 bool idxUpDown2(idx_type &, pos_type & pos, bool up, int targetx) const;
28 /// row corresponding to given position
29 idx_type pos2row(pos_type pos) const;
31 mutable MathGridInset cache_;