lyx_mirror/src/mathed/math_pos.h
André Pönitz c2771dd61f Fix for the 'spurious selection with RMB' and improved 'cursor up/down'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5416 a592a061-630c-0410-9148-cb99ea01b6c8
2002-10-15 16:17:40 +00:00

48 lines
1.1 KiB
C++

#ifndef MATH_POS_H
#define MATH_POS_H
#ifdef __GNUG__
#pragma interface
#endif
#include <iosfwd>
#include "math_data.h"
/// Description of a position
class MathCursorPos {
public:
///
MathCursorPos();
///
explicit MathCursorPos(MathInset *);
/// returns cell corresponding to this position
MathArray & cell() const;
/// returns cell corresponding to this position
MathArray & cell(MathArray::idx_type idx) const;
/// gets screen position of the thing
void getPos(int & x, int & y) const;
/// set position
void setPos(MathArray::pos_type pos);
public:
/// pointer to an inset
MathInset * par_;
/// cell index of a position in this inset
MathArray::idx_type idx_;
/// position in this cell
MathArray::pos_type pos_;
};
/// test for equality
bool operator==(MathCursorPos const &, MathCursorPos const &);
/// test for inequality
bool operator!=(MathCursorPos const &, MathCursorPos const &);
/// test for order
bool operator<(MathCursorPos const &, MathCursorPos const &);
/// output
std::ostream & operator<<(std::ostream &, MathCursorPos const &);
#endif