]> git.lyx.org Git - lyx.git/blob - src/mathed/math_pos.h
Jean-Marc's fix for wrong descent
[lyx.git] / src / mathed / math_pos.h
1 #ifndef MATH_POS_H
2 #define MATH_POS_H
3
4
5 #include <iosfwd>
6 #include "math_data.h"
7
8
9 /// Description of a position
10 class MathCursorPos {
11 public:
12         ///
13         MathCursorPos();
14         ///
15         explicit MathCursorPos(MathInset *);
16
17         /// returns cell corresponding to this position
18         MathArray & cell() const;
19         /// returns cell corresponding to this position
20         MathArray & cell(MathArray::idx_type idx) const;
21         /// gets screen position of the thing
22         void getPos(int & x, int & y) const;
23         /// set position
24         void setPos(MathArray::pos_type pos);
25
26 public:
27         /// pointer to an inset
28         MathInset * par_;
29         /// cell index of a position in this inset
30         MathArray::idx_type idx_;
31         /// position in this cell
32         MathArray::pos_type pos_;
33 };
34
35 /// test for equality
36 bool operator==(MathCursorPos const &, MathCursorPos const &);
37 /// test for inequality
38 bool operator!=(MathCursorPos const &, MathCursorPos const &);
39 /// test for order
40 bool operator<(MathCursorPos const &, MathCursorPos const &);
41 /// output
42 std::ostream & operator<<(std::ostream &, MathCursorPos const &);
43
44 #endif