]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.h
prepare infrastructure for multicell selection
[lyx.git] / src / mathed / math_cursor.h
index df762363b1621cf026dd33416d296ead4d5f30b6..da2a4ecf769ae7d709e3fb4fdc7770d60d87e52f 100644 (file)
@@ -25,7 +25,7 @@
 
 class MathInset;
 class MathFuncInset;
-class MathScriptInset;
+class MathUpDownInset;
 class InsetFormulaBase;
 class MathArray;
 class MathXArray;
@@ -56,6 +56,8 @@ public:
        /// Put the cursor in the last position
        void last();
        ///
+       bool plainLeft();
+       ///
        bool plainRight();
        ///
        void Delete();
@@ -80,10 +82,6 @@ public:
        void SetSize(MathStyles);
        ///
        bool toggleLimits();
-       /// Set accent: if argument = 0 it's considered consumed 
-       void setAccent(int ac = 0);
-       /// Returns last accent
-       int getAccent() const;
        ///
        // Macro mode methods
        void MacroModeOpen();
@@ -118,11 +116,21 @@ public:
        ///
        void handleFont(MathTextCodes t);
        ///
+       void handleAccent(string const & name, int code);
+       ///
+       void handleDelim(int l, int r);
+       /// Splits cells and shifts right part to the next cell
+       void splitCell();
+       /// Splits line and insert new row of cell 
+       void breakLine();
+       ///
        MathTextCodes getLastCode() const;
        ///
-       int idx() const { return idx_; }
+       int idx() const { return cursor_.idx_; }
+       ///
+       void idxNext();
        ///
-       void idxRight();
+       void idxPrev();
        ///
        void pullArg();
        ///
@@ -132,8 +140,6 @@ public:
        ///
        MathTextCodes prevCode() const;
        ///
-       void selArray(MathArray &) const;
-       ///
        char valign() const;
        ///
        char halign() const;
@@ -147,27 +153,12 @@ public:
        bool macro_mode;
        
        // Selection stuff
-       ///
+       /// do we currently select
        bool selection;
-       ///
-       int anchor_;
-       ///
-       int cursor_;
-       ///
-       int idx_;
-       ///
-       MathInset       * par_;
+
        ///
        InsetFormulaBase * const formula_;
        ///
-       void doAccent(char c, MathTextCodes t);
-       ///
-       void doAccent(MathInset * p);
-       ///
-       int accent;
-       ///
-       int nestaccent[8];
-       ///
        MathTextCodes lastcode;
 
        ///
@@ -188,14 +179,25 @@ public:
 private:
        /// Description of a position 
        struct MathIter {
+               /// inset
                MathInset * par_;
+               /// cell inset
                int idx_;
-               int cursor_;
+               ///
+               int pos_;
        };
 
-       /// MathPath
+       /// path of positions the cursor had to go if it were leving each inset
        std::vector<MathIter> path_;
 
+       /// reference to the last item of the path
+       MathIter anchor_;
+       ///
+       MathIter cursor_;
+       ///
+       int path_idx_;
+
+
        ///  
        int last() const;
        ///
@@ -213,27 +215,15 @@ private:
        ///
        bool nextIsInset() const;
        ///
-       bool nextIsActive() const;
-       ///
        bool prevIsInset() const;
        ///
-       bool prevIsActive() const;
-       ///
-       bool IsFont() const;
-       ///
-       bool IsScript() const;
-       ///
        void merge(MathArray const & arr);
        ///
        MathInset * nextInset() const;
        ///
-       MathInset * nextActiveInset() const;
-       ///
        MathInset * prevInset() const;
        ///
-       MathInset * prevActiveInset() const;
-       ///
-       MathScriptInset * nearbyScriptInset() const;
+       MathUpDownInset * nearbyUpDownInset() const;
 
        ///
        MathFuncInset * imacro;