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