3 * \file math_textinset.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef MATH_TEXTINSET_H
13 #define MATH_TEXTINSET_H
15 #include "math_gridinset.h"
18 // not yet a substitute for the real text inset...
20 class MathTextInset : public MathNestInset {
25 virtual std::auto_ptr<InsetBase> clone() const;
26 /// get cursor position
27 void getScreenPos(idx_type idx, pos_type pos, int & x, int & y) const;
28 /// this stores metrics information in cache_
29 void metrics(MetricsInfo & mi, Dimension & dim) const;
30 /// draw according to cached metrics
31 void draw(PainterInfo &, int x, int y) const;
32 /// draw selection background
33 void drawSelection(PainterInfo & pi,
34 idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const;
35 /// moves cursor up or down
36 bool idxUpDown2(idx_type &, pos_type & pos, bool up, int targetx) const;
38 /// row corresponding to given position
39 idx_type pos2row(pos_type pos) const;
41 mutable MathGridInset cache_;