]> git.lyx.org Git - lyx.git/blob - src/mathed/math_pos.h
merge MathArray and MathXArray classes.
[lyx.git] / src / mathed / math_pos.h
1 #ifndef MATH_POS_H
2 #define MATH_POS_H
3
4 #include <iosfwd>
5 #include "math_data.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         /// gets screen position of the thing
21         void getPos(int & x, int & y) const;
22
23 public:
24         /// pointer to an inset
25         MathInset * par_;
26         /// cell index of a position in this inset
27         MathArray::idx_type idx_;
28         /// position in this cell
29         MathArray::pos_type pos_;
30 };
31
32 /// test for equality
33 bool operator==(MathCursorPos const &, MathCursorPos const &);
34 /// test for inequality
35 bool operator!=(MathCursorPos const &, MathCursorPos const &);
36 /// test for order
37 bool operator<(MathCursorPos const &, MathCursorPos const &);
38 /// output
39 std::ostream & operator<<(std::ostream &, MathCursorPos const &);
40
41 #endif