]> git.lyx.org Git - lyx.git/blob - src/mathed/math_pos.h
Georg Baum's vspace change
[lyx.git] / src / mathed / math_pos.h
1 // -*- C++ -*-
2 /**
3  * \file math_pos.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef MATH_POS_H
13 #define MATH_POS_H
14
15
16 #include <iosfwd>
17 #include "math_data.h"
18
19
20 /// Description of a position
21 class CursorPos {
22 public:
23         ///
24         CursorPos();
25         ///
26         explicit CursorPos(MathInset *);
27
28         /// returns cell corresponding to this position
29         MathArray & cell() const;
30         /// returns cell corresponding to this position
31         MathArray & cell(MathArray::idx_type idx) const;
32         /// gets screen position of the thing
33         void getPos(int & x, int & y) const;
34         /// set position
35         void setPos(MathArray::pos_type pos);
36
37 public:
38         /// pointer to an inset
39         MathInset * inset_;
40         /// cell index of a position in this inset
41         MathArray::idx_type idx_;
42         /// position in this cell
43         MathArray::pos_type pos_;
44 };
45
46 /// test for equality
47 bool operator==(CursorPos const &, CursorPos const &);
48 /// test for inequality
49 bool operator!=(CursorPos const &, CursorPos const &);
50 /// test for order
51 bool operator<(CursorPos const &, CursorPos const &);
52 /// output
53 std::ostream & operator<<(std::ostream &, CursorPos const &);
54
55 #endif