]> git.lyx.org Git - lyx.git/blob - src/mathed/math_pos.h
more trivial tweaks to mathed bindings
[lyx.git] / src / mathed / math_pos.h
1 #ifndef MATH_POS_H
2 #define MATH_POS_H
3
4 #ifdef __GNUG__
5 #pragma interface
6 #endif
7
8 #include <iosfwd>
9 #include "math_data.h"
10
11
12 /// Description of a position
13 class MathCursorPos {
14 public:
15         ///
16         MathCursorPos();
17         ///
18         explicit MathCursorPos(MathInset *);
19
20         /// returns cell corresponding to this position
21         MathArray & cell() const;
22         /// returns cell corresponding to this position
23         MathArray & cell(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