]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_inset.h
oh well
[lyx.git] / src / mathed / math_inset.h
index 6783d5714c3704398c6df0737fc673c232379321..3bdff2dbbfd94c905fe61afec9b5817aa9b8a0d9 100644 (file)
@@ -1,8 +1,8 @@
 // -*- C++ -*-
 /*
  *  File:        math_inset.h
- *  Purpose:     Declaration of insets for mathed 
- *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx> 
+ *  Purpose:     Declaration of insets for mathed
+ *  Author:      Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
  *  Created:     January 1996
  *  Description: Math paragraph and objects for a WYSIWYG math editor.
  *
@@ -35,7 +35,7 @@
 
 Abstract base class for all math objects.  A math insets is for use of the
 math editor only, it isn't a general LyX inset. It's used to represent all
-the math objects. 
+the math objects.
 
 Math insets do not know there parents, a cursor position or things
 like that. The are dumb object that are contained in other math insets
@@ -47,6 +47,7 @@ inclusion in the "real LyX insets" FormulaInset and FormulaMacroInset.
 
 
 class MathArrayInset;
+class MathAMSArrayInset;
 class MathBraceInset;
 class MathBoxInset;
 class MathCharInset;
@@ -80,7 +81,7 @@ class MathPosFinder;
 
 
 class MathInset {
-public: 
+public:
        /// short of anything else reasonable
        typedef MathArray::size_type        size_type;
        /// type for cursor positions differences within a cell
@@ -110,9 +111,9 @@ public:
        virtual void draw(Painter &, int x, int y) const;
        /// the ascent of the inset above the baseline
        /// compute the size of the object for text based drawing
-       virtual void metrics(TextMetricsInfo const & st) const;
+       virtual void metricsT(TextMetricsInfo const & st) const;
        /// draw the object as text
-       virtual void draw(TextPainter &, int x, int y) const;
+       virtual void drawT(TextPainter &, int x, int y) const;
        /// the ascent of the inset above the baseline
        virtual int ascent() const { return 1; }
        /// the descent of the inset below the baseline
@@ -122,10 +123,8 @@ public:
        /// total height (== ascent + descent)
        virtual int height() const;
 
-       /// Where should we go when we press the up cursor key?
-       virtual bool idxUp(idx_type & idx) const;
-       /// The down key
-       virtual bool idxDown(idx_type & idx) const;
+       /// Where should we go when we press the up or down cursor key?
+       virtual bool idxUpDown(idx_type & idx, bool up) const;
        /// The left key
        virtual bool idxLeft(idx_type & idx, pos_type & pos) const;
        /// The right key
@@ -147,9 +146,9 @@ public:
        virtual bool idxEnd(idx_type & idx, pos_type & pos) const;
 
        /// Delete a cell and move cursor
-       // the return value indicates whether the cursor should leave the inset
-       // and/or the whole inset should be deleted
-       virtual void idxDelete(idx_type & idx, bool & popit, bool & deleteit);
+       virtual bool idxDelete(idx_type &) { return false; }
+       /// pulls cell after pressing erase
+       virtual void idxGlue(idx_type) {}
        // returns list of cell indices that are "between" from and to for
        // selection purposes
        virtual std::vector<idx_type> idxBetween(idx_type from, idx_type to) const;
@@ -165,7 +164,7 @@ public:
        virtual MathXArray & xcell(idx_type);
        /// return cell plus drawing cache given its number
        virtual MathXArray const & xcell(idx_type) const;
-                       
+
        /// the number of columns of this inset if it is grid-like
        virtual col_type ncols() const { return 1; }
        /// the number of rows of this inset if it is grid-like
@@ -184,6 +183,7 @@ public:
        virtual bool validCell(idx_type) const { return true; }
 
        /// identifies certain types of insets
+       virtual MathAMSArrayInset      * asAMSArrayInset()      { return 0; }
        virtual MathArrayInset         * asArrayInset()         { return 0; }
        virtual MathBraceInset         * asBraceInset()         { return 0; }
        virtual MathBoxInset           * asBoxInset()           { return 0; }
@@ -206,14 +206,11 @@ public:
        virtual MathSymbolInset const  * asSymbolInset() const  { return 0; }
        virtual MathUnknownInset const * asUnknownInset() const { return 0; }
        virtual MathXYMatrixInset const* asXYMatrixInset() const{ return 0; }
-       virtual UpdatableInset     * asHyperActiveInset() const { return 0; }
 
        /// identifies things that can get scripts
        virtual bool isScriptable() const { return false; }
        /// thing that can be moved into
        virtual bool isActive() const { return nargs() > 0; }
-       /// identifies insets from the outer world
-       virtual bool isHyperActive() const { return 0; }
        /// is the a relational operator (used for splitting equations)
        virtual bool isRelOp() const { return false; }