]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_gridinset.h
mathed uglyfication
[lyx.git] / src / mathed / math_gridinset.h
index f331000b174673c743f8f7574dd5d5afb1d81c31..37ff4a289b8eec34ed140a5cd9d4af5a46ff2fca 100644 (file)
@@ -13,8 +13,7 @@
 #define MATH_GRID_H
 
 #include "math_nestinset.h"
-#include "vspace.h"
-#include "support/std_string.h"
+#include "lyxlength.h"
 
 
 /** Gridded math inset base class.
@@ -31,7 +30,7 @@ public:
                /// a dummy cell before a multicolumn cell
                int dummy_;
                /// special multi colums alignment
-               string align_;
+               std::string align_;
                /// these should be a per-cell property, but ok to have it here
                /// for single-column grids like paragraphs
                mutable int glue_;
@@ -87,11 +86,11 @@ public:
        /// sets nrows and ncols to 1
        MathGridInset();
        /// constructor from columns description, creates one row
-       MathGridInset(char valign, string const & halign);
+       MathGridInset(char valign, std::string const & halign);
        /// Note: columns first!
        MathGridInset(col_type m, row_type n);
        ///
-       MathGridInset(col_type m, row_type n, char valign, string const & halign);
+       MathGridInset(col_type m, row_type n, char valign, std::string const & halign);
        /// Ensures that the dialog is closed.
        ~MathGridInset();
        ///
@@ -107,13 +106,13 @@ public:
        ///
        void drawT(TextPainter & pi, int x, int y) const;
        ///
-       void halign(string const & align);
+       void halign(std::string const & align);
        ///
        void halign(char c, col_type col);
        ///
        char halign(col_type col) const;
        ///
-       string halign() const;
+       std::string halign() const;
        ///
        void valign(char c);
        ///
@@ -136,9 +135,6 @@ public:
        MathGridInset * asGridInset() { return this; }
        /// identifies GridInset
        MathGridInset const * asGridInset() const { return this; }
-       /// local dispatcher
-       dispatch_result dispatch(FuncRequest const & cmd, idx_type & idx, pos_type & pos);
-
        ///
        col_type ncols() const;
        ///
@@ -149,19 +145,19 @@ public:
        row_type row(idx_type idx) const;
 
        ///
-       bool idxUpDown(idx_type & idx, pos_type & pos, bool up, int targetx) const;
+       bool idxUpDown(BufferView &, bool up, int targetx) const;
        ///
-       bool idxLeft(idx_type & idx, pos_type & pos) const;
+       bool idxLeft(BufferView &) const;
        ///
-       bool idxRight(idx_type & idx, pos_type & pos) const;
+       bool idxRight(BufferView &) const;
        ///
-       bool idxFirst(idx_type & idx, pos_type & pos) const;
+       bool idxFirst(BufferView &) const;
        ///
-       bool idxLast(idx_type & idx, pos_type & pos) const;
+       bool idxLast(BufferView &) const;
        ///
-       bool idxHome(idx_type & idx, pos_type & pos) const;
+       bool idxHome(BufferView &) const;
        ///
-       bool idxEnd(idx_type & idx, pos_type & pos) const;
+       bool idxEnd(BufferView &) const;
        ///
        bool idxDelete(idx_type & idx);
        /// pulls cell after pressing erase
@@ -219,18 +215,23 @@ public:
        //void octave(OctaveStream &) const;
 
 protected:
+       ///
+       virtual
+       DispatchResult
+       priv_dispatch(BufferView & bv, FuncRequest const & cmd);
+
        /// returns x offset of cell compared to inset
        int cellXOffset(idx_type idx) const;
        /// returns y offset of cell compared to inset
        int cellYOffset(idx_type idx) const;
        /// returns proper 'end of line' code for LaTeX
-       virtual string eolString(row_type row, bool fragile = false) const;
+       virtual std::string eolString(row_type row, bool fragile = false) const;
        /// returns proper 'end of column' code for LaTeX
-       virtual string eocString(col_type col, col_type lastcol) const;
+       virtual std::string eocString(col_type col, col_type lastcol) const;
        /// extract number of columns from alignment string
-       col_type guessColumns(string const & halign) const;
+       col_type guessColumns(std::string const & halign) const;
        /// splits cells and shifts right part to the next cell
-       void splitCell(idx_type &, pos_type & pos);
+       void splitCell(BufferView & pos);
 
 public:
        /// row info