#ifndef MATH_INSET_H
#define MATH_INSET_H
+#include <config.h>
+
#ifdef __GNUG__
#pragma interface
#endif
*/
+class LaTeXFeatures;
+
class MathInset {
public:
/** A math inset has a name (usually its LaTeX name),
type and font-size
*/
///
- explicit
- MathInset (string const & nm = string(), MathInsetTypes ot = LM_OT_SIMPLE, int na = 0);
+ explicit MathInset
+ (int na = 0, string const & nm = string(), MathInsetTypes ot = LM_OT_SIMPLE);
+
/// The virtual base destructor
virtual ~MathInset() {}
/// Appends itself with macro arguments substituted
virtual void substitute(MathArray & array, MathMacro const & macro) const;
/// Compute the size of the object
- virtual void Metrics(MathStyles st) = 0;
+ virtual void Metrics(MathStyles st, int = 0, int = 0) = 0;
///
virtual int ascent() const;
///
///
virtual int height() const;
///
- virtual bool hasLimits() const;
- ///
virtual int limits() const;
///
virtual void limits(int);
/// The right key
virtual bool idxRight(int & idx, int & pos) const;
+ /// Move one physical cell up
+ virtual bool idxNext(int & idx, int & pos) const;
+ /// Move one physical cell down
+ virtual bool idxPrev(int & idx, int & pos) const;
+
/// Target pos when we enter the inset from the left by pressing "Right"
virtual bool idxFirst(int & idx, int & pos) const;
/// Target pos when we enter the inset from the left by pressing "Up"
virtual bool idxEnd(int & idx, int & pos) const;
/// Delete a cell and move cursor
- // a return value true indicates that the whole inset should be deleted
- virtual bool idxDelete(int idx);
+ // the return value indicates whether the cursor should leave the inset
+ // and/or the whole inset should be deleted
+ virtual void idxDelete(int & idx, bool & popit, bool & deleteit);
+ // deletes a cell range and moves the cursor
+ virtual void idxDeleteRange(int from, int to);
+ // returns list of cell indices that are "between" from and to for
+ // selction purposes
+ virtual std::vector<int> idxBetween(int from, int to) const;
///
int nargs() const;
MathXArray & xcell(int);
///
MathXArray const & xcell(int) const;
- ///
- void setData(MathArray const &, int);
///
int xo() const;
///
bool covers(int x, int y) const;
/// Identifies ScriptInsets
- virtual bool isScriptInset() const { return false; }
+ virtual bool isUpDownInset() const { return false; }
+ /// Identifies BigopInsets
+ virtual bool isBigopInset() const { return false; }
///
virtual bool isActive() const { return nargs() > 0; }
///
void push_back(MathInset *);
///
- void push_back(byte ch, MathTextCodes fcode);
+ void push_back(unsigned char ch, MathTextCodes fcode);
///
void dump() const;
///
+ void Validate(LaTeXFeatures & features) const;
+
///
static int workwidth;
protected: