]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.h
more cursor dispatch
[lyx.git] / src / cursor.h
index e4d1ebc2a1d27df87eb17d19d1740efaa483a424..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
@@ -390,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();