CursorSlice const & current() const;
/// how many nested insets do we have?
size_t depth() const { return cursor_.size(); }
+ /// depth of current slice
+ int currentDepth() const { return current_; }
//
// selection
//
// access to the 'current' cursor slice
//
- /// the current inset
+ /// the containing inset
InsetBase * inset() const { return current().inset(); }
/// return the cell of the inset this cursor is in
idx_type idx() const { return current().idx(); }
par_type par() const { return current().par(); }
/// return the paragraph this cursor is in
par_type & par() { return current().par(); }
+ /// return the last possible paragraph in this inset
+ par_type lastpar() const;
/// return the position within the paragraph
pos_type pos() const { return current().pos(); }
/// return the position within the paragraph
pos_type & pos() { return current().pos(); }
/// return the last position within the paragraph
pos_type lastpos() const;
+ /// return the display row of the cursor with in the current par
+ row_type crow() const;
+ /// return the display row of the cursor with in the current par
+ row_type lastcrow() const;
+
/// return the number of embedded cells
size_t nargs() const;
/// return the number of embedded cells
row_type row() const;
/// return the grid row of the current cell
col_type col() const;
+ /// the inset just behind the cursor
+ InsetBase * nextInset();
+ /// the inset just in front of the cursor
+ InsetBase * prevInset();
//
// math-specific part
/// are we currently typing '#1' or '#2' or...?
bool inMacroArgMode() const;
- /// draws light-blue selection background
- void drawSelection(PainterInfo & pi);
/// replace selected stuff with at, placing the former
// selection in given cell of atom
void handleNest(MathAtom const & at, int cell = 0);
void handleFont(std::string const & font);
void releaseMathCursor();
-
+ /// are we in mathed?
bool inMathed() const;
+ /// display a message
+ void message(std::string const & msg) const;
+ /// display an error message
+ void errorMessage(std::string const & msg) const;
+
private:
/// moves cursor index one cell to the left
bool idxLeft();