class MathInset;
class MathFuncInset;
-class MathScriptInset;
+class MathUpDownInset;
class InsetFormulaBase;
class MathArray;
class MathXArray;
/// Put the cursor in the last position
void last();
///
+ bool plainLeft();
+ ///
+ bool plainRight();
+ ///
void Delete();
///
void DelLine();
void SetSize(MathStyles);
///
bool toggleLimits();
- /// Set accent: if argument = 0 it's considered consumed
- void setAccent(int ac = 0);
- /// Returns last accent
- int getAccent() const;
///
// Macro mode methods
void MacroModeOpen();
///
void setLastCode(MathTextCodes t);
///
- void toggleLastCode(MathTextCodes t);
+ void handleFont(MathTextCodes t);
+ ///
+ void handleAccent(string const & name, int code);
+ ///
+ void handleDelim(int l, int r);
+ /// Splits cells and shifts right part to the next cell
+ void splitCell();
+ /// Splits line and insert new row of cell
+ void breakLine();
///
MathTextCodes getLastCode() const;
///
- int idx() const { return idx_; }
+ int idx() const { return cursor_.idx_; }
+ ///
+ void idxNext();
///
- void idxRight();
+ void idxPrev();
///
void pullArg();
///
///
MathTextCodes prevCode() const;
///
- void selArray(MathArray &) const;
-
+ char valign() const;
+ ///
+ char halign() const;
+ ///
+ int col() const;
+ ///
+ int row() const;
+
//protected:
///
bool macro_mode;
// Selection stuff
- ///
+ /// do we currently select
bool selection;
- ///
- int anchor_;
- ///
- int cursor_;
- ///
- int idx_;
- ///
- MathInset * par_;
+
///
InsetFormulaBase * const formula_;
///
- void doAccent(char c, MathTextCodes t);
- ///
- void doAccent(MathInset * p);
- ///
- int accent;
- ///
- int nestaccent[8];
- ///
MathTextCodes lastcode;
///
///
MathStyles style() const;
- ///
+ /// Make sure cursor position is valid
void normalize() const;
+ /// Enter a new MathInset from the front or the back
+ void push(MathInset * par, bool first);
+ /// Leave current MathInset
+ bool pop();
+
private:
/// Description of a position
struct MathIter {
+ /// inset
MathInset * par_;
+ /// cell inset
int idx_;
- int cursor_;
+ ///
+ int pos_;
};
- /// MathPath
+ /// path of positions the cursor had to go if it were leving each inset
std::vector<MathIter> path_;
- ///
- void push(MathInset * par, bool first);
+ /// reference to the last item of the path
+ MathIter anchor_;
+ ///
+ MathIter cursor_;
///
- void pop();
+ int path_idx_;
+
+
///
int last() const;
///
///
bool nextIsInset() const;
///
- bool nextIsActive() const;
- ///
bool prevIsInset() const;
///
- bool prevIsActive() const;
- ///
- bool IsFont() const;
- ///
- bool IsScript() const;
- ///
void merge(MathArray const & arr);
///
MathInset * nextInset() const;
///
- MathInset * nextActiveInset() const;
- ///
MathInset * prevInset() const;
///
- MathInset * prevActiveInset() const;
- ///
- MathScriptInset * prevScriptInset() const;
- ///
- int col() const;
- ///
- int row() const;
+ MathUpDownInset * nearbyUpDownInset() const;
///
MathFuncInset * imacro;