lyx_mirror/src/lyxcursor.h
Jean-Marc Lasgouttes 4b2a999762 GUI-indep toolbar and menus mostly work !
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@913 a592a061-630c-0410-9148-cb99ea01b6c8
2000-07-24 13:53:19 +00:00

93 lines
1.4 KiB
C++

// -*- C++ -*-
/* This file is part of
* ======================================================
*
* LyX, The Document Processor
*
* Copyright 1995 Matthias Ettrich
* Copyright 1995-2000 The LyX Team.
*
* ====================================================== */
#ifndef LYXCURSOR_H
#define LYXCURSOR_H
#ifdef __GNUG__
#pragma interface
#endif
#include "lyxparagraph.h"
struct Row;
/** All these variables should be explained. Matthias?
*/
class LyXCursor {
public:
///
void par(LyXParagraph * p);
///
LyXParagraph * par();
///
LyXParagraph * par() const;
///
void pos(LyXParagraph::size_type p);
///
LyXParagraph::size_type pos() const;
///
void boundary(bool b);
///
bool boundary() const;
///
void x(int i);
///
int x() const;
///
void x_fix(int i);
///
int x_fix() const;
///
void y(unsigned long i);
///
unsigned long y() const;
///
void row(Row * r);
///
Row * row();
///
Row * row() const;
private:
/// The paragraph the cursor is in.
LyXParagraph * par_;
/// The position inside the paragraph
LyXParagraph::size_type pos_;
///
bool boundary_;
///
int x_;
///
int x_fix_;
///
unsigned long y_;
///
Row * row_;
};
inline
bool operator==(LyXCursor const & a, LyXCursor const & b)
{
return (a.par() == b.par())
&& (a.pos() == b.pos())
&& a.boundary() == b.boundary();
}
inline
bool operator!=(LyXCursor const & a, LyXCursor const & b)
{
return !(a == b);
}
#endif