// -*- 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.
*
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
class MathInset {
-public:
+public:
/// short of anything else reasonable
typedef MathArray::size_type size_type;
/// type for cursor positions differences within a cell
/// 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
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;
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