]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parboxinset.h
the up/down stuff reworked
[lyx.git] / src / mathed / math_parboxinset.h
1 #ifndef MATH_PARBOXINSET_H
2 #define MATH_PARBOXINSET_H
3
4 #include "math_nestinset.h"
5
6 class MathParboxInset : public MathNestInset {
7 public:
8         ///
9         MathParboxInset();
10         ///
11         MathParboxInset * asParboxInset() { return this; }
12         ///
13         MathInset * clone() const;
14         ///
15         mode_type currentMode() const { return TEXT_MODE; }
16         /// get cursor position
17         void getPos(idx_type idx, pos_type pos, int & x, int & y) const;
18         ///
19         void metrics(MathMetricsInfo & mi) const;
20         ///
21         void draw(MathPainterInfo &, int x, int y) const;
22         /// draw selection background
23         void drawSelection(MathPainterInfo & pi,
24                 idx_type idx1, pos_type pos1, idx_type idx2, pos_type pos2) const;
25         ///
26         void infoize(std::ostream & os) const;
27         ///
28         void write(WriteStream & os) const;
29         ///
30         void setWidth(string const & width);
31         ///
32         void setPosition(string const & pos);
33         /// moves cursor up or down
34         bool idxUpDown(idx_type &, pos_type & pos, bool up, int targetx) const;
35 private:
36         /// number of rows on screen
37         int screenrows() const;
38         /// row corresponding to given position 
39         int pos2row(pos_type pos) const;
40         /// width on screen
41         int lyx_width_;
42         /// width for TeX
43         string tex_width_;
44         /// htb
45         char position_;
46         /// cached metrics
47         mutable std::vector<MathXArray::Row> rows_;
48 };
49
50 #endif