]> git.lyx.org Git - lyx.git/blob - src/mathed/math_pos.h
Fix reading of math macros
[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         /// set position
27         void setPos(MathArray::pos_type pos);
28
29 public:
30         /// pointer to an inset
31         MathInset * par_;
32         /// cell index of a position in this inset
33         MathArray::idx_type idx_;
34         /// position in this cell
35         MathArray::pos_type pos_;
36 };
37
38 /// test for equality
39 bool operator==(MathCursorPos const &, MathCursorPos const &);
40 /// test for inequality
41 bool operator!=(MathCursorPos const &, MathCursorPos const &);
42 /// test for order
43 bool operator<(MathCursorPos const &, MathCursorPos const &);
44 /// output
45 std::ostream & operator<<(std::ostream &, MathCursorPos const &);
46
47 #endif