]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.h
more cursor dispatch
[lyx.git] / src / cursor.h
index 59519bbb865c2e7c23d69ca4d495aac2ad4a5ff5..0951333da97d878c1449e99fdd301da982ac948f 100644 (file)
@@ -82,6 +82,8 @@ public:
        CursorSlice const & current() const;
        /// how many nested insets do we have?
        size_t depth() const { return cursor_.size(); }
+       /// depth of current slice
+       int currentDepth() const { return current_; }
 
        //
        // selection
@@ -137,7 +139,7 @@ public:
        //
        // access to the 'current' cursor slice
        //
-       /// the current inset
+       /// the containing inset
        InsetBase * inset() const { return current().inset(); }
        /// return the cell of the inset this cursor is in
        idx_type idx() const { return current().idx(); }
@@ -149,12 +151,19 @@ public:
        par_type par() const { return current().par(); }
        /// return the paragraph this cursor is in
        par_type & par() { return current().par(); }
+       /// return the last possible paragraph in this inset
+       par_type lastpar() const;
        /// return the position within the paragraph
        pos_type pos() const { return current().pos(); }
        /// return the position within the paragraph
        pos_type & pos() { return current().pos(); }
        /// return the last position within the paragraph
        pos_type lastpos() const;
+       /// return the display row of the cursor with in the current par
+       row_type crow() const;
+       /// return the display row of the cursor with in the current par
+       row_type lastcrow() const;
+
        /// return the number of embedded cells
        size_t nargs() const;
        /// return the number of embedded cells
@@ -165,6 +174,10 @@ public:
        row_type row() const;
        /// return the grid row of the current cell
        col_type col() const;
+       /// the inset just behind the cursor
+       InsetBase * nextInset();
+       /// the inset just in front of the cursor
+       InsetBase * prevInset();
 
        //
        // math-specific part
@@ -195,10 +208,14 @@ public:
        ///
        bool boundary() const { return current().boundary(); }
        ///
+       bool & boundary() { return current().boundary(); }
+       ///
        Paragraph & paragraph();
        ///
        Paragraph const & paragraph() const;
        ///
+       LyXText * text() const;
+       ///
        InsetBase * innerInsetOfType(int code) const;
        ///
        InsetTabular * innerInsetTabular() const;
@@ -219,10 +236,12 @@ public:
        /// move one step to the right
        bool posRight();
 
-       /// set target x position of cursor
-       void x_target(int x);
+       /// write acess to target x position of cursor
+       int & x_target();
        /// return target x position of cursor
        int x_target() const;
+       /// clear target x position of cursor
+       void clearTargetX();
 
        /// access to selection anchor
        CursorSlice & anchor();
@@ -251,13 +270,8 @@ public:
        std::vector<CursorSlice> anchor_;
 
 private:
-       /// don't implement this
-       void operator=(LCursor const &);
-       /// don't implement this
-       LCursor(LCursor const &);
-
        ///
-       BufferView * const bv_;
+       BufferView * bv_;
        /// current slice
        int current_;
        ///
@@ -331,8 +345,6 @@ public:
 
        /// in pixels from top of screen
        void setScreenPos(int x, int y);
-       /// in pixels from top of screen
-       void getScreenPos(int & x, int & y) const;
        /// in pixels from left of screen
        int targetX() const;
        /// return the next enclosing grid inset and the cursor's index in it
@@ -355,8 +367,6 @@ public:
        /// are we currently typing '#1' or '#2' or...?
        bool inMacroArgMode() const;
 
-       /// draws light-blue selection background
-       void drawSelection(PainterInfo & pi);
        /// replace selected stuff with at, placing the former
        // selection in given cell of atom
        void handleNest(MathAtom const & at, int cell = 0);
@@ -393,9 +403,14 @@ public:
        void handleFont(std::string const & font);
 
        void releaseMathCursor();
-
+       /// are we in mathed?
        bool inMathed() const;
 
+       /// display a message
+       void message(std::string const & msg) const;
+       /// display an error message
+       void errorMessage(std::string const & msg) const;
+
 private:
        /// moves cursor index one cell to the left
        bool idxLeft();