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
///
bool boundary() const { return current().boundary(); }
///
+ bool & boundary() { return current().boundary(); }
+ ///
Paragraph & paragraph();
///
Paragraph const & paragraph() const;
///
+ LyXText * text() const;
+ ///
InsetBase * innerInsetOfType(int code) const;
///
InsetTabular * innerInsetTabular() const;
/// move one step to the right
bool posRight();
- /// set target x position of cursor
- void x_target(int x);
+ /// write acess to target x position of cursor
+ int & x_target();
/// return target x position of cursor
int x_target() const;
+ /// clear target x position of cursor
+ void clearTargetX();
/// access to selection anchor
CursorSlice & anchor();
std::vector<CursorSlice> anchor_;
private:
- /// don't implement this
- void operator=(LCursor const &);
- /// don't implement this
- LCursor(LCursor const &);
-
///
- BufferView * const bv_;
+ BufferView * bv_;
/// current slice
int current_;
///
/// in pixels from top of screen
void setScreenPos(int x, int y);
- /// in pixels from top of screen
- void getScreenPos(int & x, int & y) const;
/// in pixels from left of screen
int targetX() const;
/// return the next enclosing grid inset and the cursor's index in it
/// 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();