#include "math_defs.h"
class MathInset;
+class MathAtom;
class MathArrayInset;
class MathFuncInset;
class MathMatrixInset;
class MathArray;
class MathXArray;
class Painter;
+class latexkeys;
/// Description of a position
struct MathCursorPos {
///
explicit MathCursor(InsetFormulaBase *);
///
- ~MathCursor();
- ///
- void insert(char, MathTextCodes t = LM_TC_MIN);
- ///
void insert(MathInset *);
///
void insert(MathArray const &);
///
void backspace();
///
- void home();
+ void home(bool sel = false);
///
- void end();
+ void end(bool sel = false);
///
bool right(bool sel = false);
///
///
void plainInsert(MathInset * p);
///
+ void niceInsert(MathInset * p);
+ ///
void delLine();
/// This is in pixels from (maybe?) the top of inset
void setPos(int, int);
bool toggleLimits();
///
// Macro mode methods
- void macroModeOpen();
- ///
void macroModeClose();
///
bool inMacroMode() const;
///
void drawSelection(Painter & pain) const;
///
- void clearLastCode();
- ///
- void setLastCode(MathTextCodes t);
- ///
void handleFont(MathTextCodes t);
///
- void handleAccent(string const & name);
- ///
- void handleDelim(int l, int r);
+ void handleDelim(latexkeys const * l, latexkeys const * r);
///
void handleNest(MathInset * p);
/// Splits cells and shifts right part to the next cell
///
MathTextCodes nextCode() const;
///
- MathTextCodes prevCode() const;
- ///
char valign() const;
///
char halign() const;
MathArray & array() const;
///
MathXArray & xarray() const;
+ ///
+ MathAtom const * prevAtom() const;
+ ///
+ MathAtom * prevAtom();
+ ///
+ MathAtom const * nextAtom() const;
+ ///
+ MathAtom * nextAtom();
/// returns the selection
void getSelection(MathCursorPos &, MathCursorPos &) const;
/// returns the normalized anchor of the selection
MathCursorPos normalAnchor() const;
- /// returns the normalized anchor of the selection
- bool openable(MathInset *, bool selection, bool useupdown) const;
/// path of positions the cursor had to go if it were leving each inset
std::vector<MathCursorPos> Cursor_;
MathSpaceInset * prevSpaceInset() const;
private:
///
- int & pos();
+ string macroName() const;
///
+ void insert(char, MathTextCodes t = LM_TC_MIN);
+ /// can we enter the inset?
+ bool openable(MathInset *, bool selection) const;
+ /// can the setPos routine enter that inset?
+ MathInset * positionable(MathAtom *, int x, int y) const;
+ /// write access to cursor cell position
+ int & pos();
+ /// write access to cursor cell index
int & idx();
/// x-offset of current cell relative to par xo
int cellXOffset() const;
InsetFormulaBase * const formula_;
///
MathTextCodes lastcode_;
- ///
- MathFuncInset * imacro_;
// Selection stuff
/// do we currently select
bool selection_;