mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 13:46:43 +00:00
1f9e9cf517
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7574 a592a061-630c-0410-9148-cb99ea01b6c8
56 lines
1.2 KiB
C++
56 lines
1.2 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file math_pos.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author André Pönitz
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef MATH_POS_H
|
|
#define MATH_POS_H
|
|
|
|
|
|
#include <iosfwd>
|
|
#include "math_data.h"
|
|
|
|
|
|
/// Description of a position
|
|
class CursorPos {
|
|
public:
|
|
///
|
|
CursorPos();
|
|
///
|
|
explicit CursorPos(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 * inset_;
|
|
/// 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==(CursorPos const &, CursorPos const &);
|
|
/// test for inequality
|
|
bool operator!=(CursorPos const &, CursorPos const &);
|
|
/// test for order
|
|
bool operator<(CursorPos const &, CursorPos const &);
|
|
/// output
|
|
std::ostream & operator<<(std::ostream &, CursorPos const &);
|
|
|
|
#endif
|