#pragma interface
#endif
-#include "paragraph.h"
+#include "support/types.h"
-struct Row;
+class Paragraph;
+class Row;
/** All these variables should be explained. Matthias?
*/
class LyXCursor {
public:
+ ///
LyXCursor();
///
void par(Paragraph * p);
///
- Paragraph * par();
- ///
Paragraph * par() const;
///
- void pos(Paragraph::size_type p);
+ void pos(lyx::pos_type p);
///
- Paragraph::size_type pos() const;
+ lyx::pos_type pos() const;
///
void boundary(bool b);
///
///
void row(Row * r);
///
- Row * row();
- ///
Row * row() const;
private:
/// The paragraph the cursor is in.
Paragraph * par_;
/// The position inside the paragraph
- Paragraph::size_type pos_;
+ lyx::pos_type pos_;
///
bool boundary_;
///
return !(a == b);
}
+///
+inline
+bool operator<(LyXCursor const & a, LyXCursor const & b)
+{
+ // Can this be done in a nother way?
+ return (a.y() < b.y() && a.pos() < b.pos());
+}
+
+///
+inline
+bool operator>(LyXCursor const & a, LyXCursor const & b)
+{
+ return b < a;
+}
+
+///
+inline
+bool operator>=(LyXCursor const & a, LyXCursor const & b)
+{
+ return !(a < b);
+}
+
+
+///
+inline
+bool operator<=(LyXCursor const & a, LyXCursor const & b)
+{
+ return !(a > b);
+}
+
#endif