]> git.lyx.org Git - lyx.git/blob - src/mathed/math_textinset.h
the clone auto_ptr patch
[lyx.git] / src / mathed / math_textinset.h
1 // -*- C++ -*-
2 #ifndef MATH_TEXTINSET_H
3 #define MATH_TEXTINSET_H
4
5 #include "math_gridinset.h"
6
7
8 // not yet a substitute for the real text inset...
9
10 class MathTextInset : public MathNestInset {
11 public:
12         ///
13         MathTextInset();
14         ///
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;
27 protected:
28         /// row corresponding to given position
29         idx_type pos2row(pos_type pos) const;
30         /// cached metrics
31         mutable MathGridInset cache_;
32 };
33
34 #endif