]> git.lyx.org Git - lyx.git/blob - src/mathed/math_parboxinset.h
some \parbox improvements
[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         ///
23         void infoize(std::ostream & os) const;
24         ///
25         void write(WriteStream & os) const;
26         ///
27         void setWidth(string const & width);
28         ///
29         void setPosition(string const & pos);
30         /// moves cursor up or down
31         bool idxUpDown(idx_type &, pos_type & pos, bool up) const;
32 private:
33         /// number of rows on screen
34         int screenrows() const;
35         /// row corresponding to given position 
36         int pos2row(pos_type pos) const;
37         /// width on screen
38         int lyx_width_;
39         /// width for TeX
40         string tex_width_;
41         /// htb
42         char position_;
43         /// cached metrics
44         mutable std::vector<MathXArray::Row> rows_;
45 };
46
47 #endif