]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.h
small mouse click stuff. still not ok...
[lyx.git] / src / mathed / math_cursor.h
index 615d3cb7b93a1e0b5751aebbcb94ad1a7c5b44a1..3aa02de9566447b9f43027439356b67e1aa575de 100644 (file)
 #include "math_inset.h"
 #include "LString.h"
 
-class MathInset;
-class MathAtom;
-class MathArrayInset;
-class MathFuncInset;
-class MathMatrixInset;
-class MathScriptInset;
-class MathSpaceInset;
 class InsetFormulaBase;
-class MathArray;
-class MathXArray;
 class Painter;
 class Selection;
-class latexkeys;
 
 /// Description of a position 
 struct MathCursorPos {
@@ -120,13 +110,15 @@ public:
        ///
        void delLine();
        /// This is in pixels from (maybe?) the top of inset
-       void setPos(int, int);
+       // don't move further in than the Anchor's inset if respect_anchor == true
+       void setPos(int x, int y, bool respect_anchor = false);
+       /// This is in pixels from (maybe?) the top of inset, don't move further
        ///
        void getPos(int & x, int & y);
        ///
        MathAtom & par() const;
        /// return the next enclosing grid inset and the cursor's index in it
-       MathArrayInset * enclosingArray(idx_type &) const;
+       MathGridInset * enclosingGrid(idx_type &) const;
        ///
        InsetFormulaBase const * formula();
        ///
@@ -136,11 +128,9 @@ public:
        ///
        size_type size() const;
        ///
-       void interpret(string const &);
+       bool interpret(string const &);
        ///
-       void interpret(char);
-       ///
-       void setSize(MathStyles);
+       bool interpret(char);
        ///
        bool toggleLimits();
        ///
@@ -167,6 +157,8 @@ public:
        ///
        void selClear();
        ///
+       void selGet(MathArray & ar);
+       ///
        void drawSelection(Painter & pain) const;
        ///
        void handleFont(MathTextCodes t);
@@ -178,6 +170,8 @@ public:
        void splitCell();
        /// Splits line and insert new row of cell 
        void breakLine();
+       /// read contents of line into an array
+       void readLine(MathArray & ar) const;
        ///
        MathTextCodes getLastCode() const;
        ///
@@ -191,12 +185,16 @@ public:
        ///
        char halign() const;
        ///
+       col_type ncols() const;
+       ///
        col_type col() const;
        ///
        row_type row() const;
 
        /// Make sure cursor position is valid
        void normalize() const;
+       ///
+       UpdatableInset * asHyperActiveInset() const;
 
        /// enter a MathInset 
        void push(MathAtom & par);
@@ -245,6 +243,8 @@ public:
        void seldump(char const * str) const;
        ///
        void dump(char const * str) const;
+       ///
+       void stripFromLastEqualSign();
 
        ///
        friend class Selection;
@@ -277,16 +277,6 @@ private:
        pos_type & pos();
        /// write access to cursor cell index
        idx_type & idx();
-       /// x-offset of current cell relative to par xo
-       int cellXOffset() const;
-       /// y-offset of current cell relative to par yo
-       int cellYOffset() const;
-       /// current x position relative to par xo
-       int xpos() const;
-       /// current y position relative to par yo
-       int ypos() const;
-       /// adjust position in current cell according to x. idx is not changed.
-       void gotoX(int x);
 
        ///
        InsetFormulaBase * const formula_;