]> git.lyx.org Git - lyx.git/blobdiff - src/lyxcursor.h
More fixes to insettabular/text (and some missing features added).
[lyx.git] / src / lyxcursor.h
index e1a8a64ef5eb9e1d97eb7046c39562ba7ea2e291..8a9ac616e0abd040e81027cc550b9b7efa591a2e 100644 (file)
 #ifndef LYXCURSOR_H
 #define LYXCURSOR_H
 
+#ifdef __GNUG__
+#pragma interface
+#endif
+
 #include "lyxparagraph.h"
 
 struct Row;
 
 /** All these variables should be explained. Matthias?
  */
-struct LyXCursor {
+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;
        ///
-       LyXParagraph * par;
+       void x(int i);
        ///
-       LyXParagraph::size_type pos;
+       int x() const;
        ///
-       bool boundary;
+       void x_fix(int i);
        ///
-       int x;
+       int x_fix() const;
        ///
-       int x_fix;
+       void y(int i);
        ///
-       unsigned long y;
+       int y() const;
        ///
-       Row * row;
+       void row(Row * r);
        ///
-       inline bool operator==(const LyXCursor &a) const
-               { return a.par == par && a.pos == pos && a.boundary == boundary ; }
-       inline bool operator!=(const LyXCursor &a) const
-               { return a.par != par || a.pos != pos || a.boundary != boundary; }
+       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_;
+       ///
+       int 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