]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.h
enable direct input of #1...#9; some whitespace changes
[lyx.git] / src / mathed / math_cursor.h
index ec6ae8934b9bdca751ea773e70dadbcb3528173d..765c19bd57692a08bc6cb61b170a2ebbefc4bf5b 100644 (file)
@@ -115,6 +115,8 @@ public:
        /// size of current cell
        size_type size() const;
        ///
+       bool script(bool);
+       ///
        bool interpret(string const &);
        ///
        bool interpret(char);
@@ -122,8 +124,10 @@ public:
        bool toggleLimits();
        /// interpret name a name of a macro
        void macroModeClose();
-       ///
+       /// are we currently typing the name of a macro?
        bool inMacroMode() const;
+       /// are we currently typing '#1' or '#2' or...?
+       bool inMacroArgMode() const;
        
        // Local selection methods
        ///
@@ -158,8 +162,8 @@ public:
        void breakLine();
        /// read contents of line into an array
        void readLine(MathArray & ar) const;
-       ///
-       MathTextCodes getLastCode() const;
+       /// remove this as soon as LyXFunc::getStatus is "localized"
+       MathTextCodes getLastCode() const { return lastcode_; }
        ///
        void pullArg(bool goright);
        ///
@@ -174,9 +178,13 @@ public:
        col_type hullCol() const;
        ///
        row_type hullRow() const;
+       ///
+       col_type gridCol() const;
+       ///
+       row_type gridRow() const;
 
        /// make sure cursor position is valid
-       void normalize() const;
+       void normalize();
        ///
        UpdatableInset * asHyperActiveInset() const;
 
@@ -216,7 +224,7 @@ public:
        /// path of positions the cursor had to go if it were leving each inset
        cursor_type Cursor_;
        /// path of positions the anchor had to go if it were leving each inset
-       cursor_type Anchor_;
+       mutable cursor_type Anchor_;
 
        /// reference to the last item of the path, i.e. "The Cursor"
        MathCursorPos & cursor();
@@ -229,6 +237,8 @@ public:
        void dump(char const * str) const;
        ///
        void stripFromLastEqualSign();
+       /// moves on 
+       void setSelection(cursor_type const & where, size_type n);
 
        ///
        friend class Selection;
@@ -242,17 +252,15 @@ private:
        bool idxLeft();
        /// moves cursor index one cell to the right
        bool idxRight();
-       /// moves position somehow up
-       bool goUp();
-       /// moves position somehow down
-       bool goDown();
+       /// moves position somehow up or down
+       bool goUpDown(bool up);
        /// moves position into box
-       bool bruteFind(int xlow, int xhigh, int ylow, int yhigh);
+       bool bruteFind(int xo, int yo, int xlow, int xhigh, int ylow, int yhigh);
 
        ///
        string macroName() const;
        ///
-       int macroNamePos() const;
+       MathInset::difference_type macroNamePos() const;
        ///
        void insert(char, MathTextCodes t);
        /// can we enter the inset?