]> git.lyx.org Git - lyx.git/blobdiff - src/cursor.h
fix tabular crashs
[lyx.git] / src / cursor.h
index 76b75f228a24810fe8a7178d6663b443cf5dc3b6..91e169f5f142a4464bdd4d6fcdc22da6bc675ce4 100644 (file)
@@ -13,6 +13,7 @@
 #define CURSOR_H
 
 #include "cursor_slice.h"
+#include "dispatchresult.h"
 
 #include <iosfwd>
 #include <vector>
@@ -146,6 +147,8 @@ public:
        std::string selectionAsString(bool label) const;
        ///
        void paste(std::string const & data);
+       ///
+       std::string currentState();
 
        //
        // access to the 'current' cursor slice
@@ -157,7 +160,7 @@ public:
        /// return the cell of the inset this cursor is in
        idx_type & idx() { return current().idx(); }
        /// return the last possible cell in this inset
-       idx_type lastidx() const { return current().lastidx(); }
+       idx_type lastidx() const;
        /// return the paragraph this cursor is in
        par_type par() const { return current().par(); }
        /// return the paragraph this cursor is in
@@ -189,6 +192,8 @@ public:
        InsetBase * nextInset();
        /// the inset just in front of the cursor
        InsetBase * prevInset();
+       /// the inset just in front of the cursor
+       InsetBase const * prevInset() const;
 
        //
        // math-specific part
@@ -276,11 +281,19 @@ public:
        /// access to owning BufferView
        BufferView & bv() const; 
        /// get some interesting description of current position
-       void info(std::ostream & os);
+       void info(std::ostream & os) const;
        /// are we in math mode (2), text mode (1) or unsure (0)?
        int currentMode();
        /// reset cursor
        void reset();
+       /// for spellchecking
+       void replaceWord(std::string const & replacestring);
+       /// update our view
+       void update();
+       ///
+       void dispatched(dispatch_result_t res);
+       void notdispatched();
+       void noupdate();
 
        /// output
        friend std::ostream & operator<<(std::ostream & os, LCursor const & cur);
@@ -290,6 +303,9 @@ public:
        std::vector<CursorSlice> cursor_;
        /// the anchor position
        std::vector<CursorSlice> anchor_;
+       
+       /// 
+       DispatchResult disp_;
 
 private:
        ///
@@ -418,7 +434,6 @@ public:
        /// split font inset etc
        void handleFont(std::string const & font);
 
-       void releaseMathCursor();
        /// are we in mathed?
        bool inMathed() const;
        /// are we in texted?
@@ -428,6 +443,8 @@ public:
        void message(std::string const & msg) const;
        /// display an error message
        void errorMessage(std::string const & msg) const;
+       ///
+       std::string getPossibleLabel();
 
 private:
        /// moves cursor index one cell to the left