#ifndef CURSORSLICE_H
#define CURSORSLICE_H
-#include <iosfwd>
#include <cstddef>
+#include <iosfwd>
#include "support/types.h"
class MathInset;
class MathArray;
class LyXText;
+class Paragraph;
class UpdatableInset;
///
explicit CursorSlice(InsetBase *);
+ /// the current inset
+ InsetBase * inset() const { return inset_; }
/// set the paragraph that contains this cursor
void idx(idx_type idx);
- /// return the paragraph this cursor is in
+ /// return the cell this cursor is in
idx_type idx() const;
- /// return the paragraph this cursor is in
+ /// return the cell this cursor is in
idx_type & idx();
+ /// return the last cell in this inset
+ idx_type lastidx() const { return nargs() - 1; }
/// set the paragraph that contains this cursor
void par(par_type par);
/// return the paragraph this cursor is in
pos_type & pos();
/// return the last position within the paragraph
pos_type lastpos() const;
+ /// return the number of embedded cells
+ size_t nargs() const;
+ /// return the number of embedded cells
+ size_t ncols() const;
+ /// return the number of embedded cells
+ size_t nrows() const;
/// return the grid row of the current cell
row_type row() const;
/// return the grid row of the current cell
col_type col() const;
- /// FIXME
- void boundary(bool b);
- /// FIXME
- bool boundary() const;
///
/// texted specific stuff
///
+ /// see comment for the member
+ void boundary(bool b);
+ /// see comment for the member
+ bool boundary() const;
+ /// see comment for the member
+ bool & boundary();
///
LyXText * text() const;
///
UpdatableInset * asUpdatableInset() const;
+ ///
+ Paragraph & paragraph();
+ ///
+ Paragraph const & paragraph() const;
///
/// mathed specific stuff
///
/// returns cell corresponding to this position
MathArray & cell() const;
- /// gets screen position of the thing
- void getScreenPos(int & x, int & y) const;
///
MathInset * asMathInset() const;
/// test for order
bool operator>(CursorSlice const &, CursorSlice const &);
-#include <vector>
-
-
-// this is used for traversing math insets
-typedef std::vector<CursorSlice> CursorBase;
-/// move on one step
-void increment(CursorBase &);
-///
-CursorBase ibegin(InsetBase * p);
-///
-CursorBase iend(InsetBase * p);
-///
-CursorSlice & cursorTip(BufferView &);
-
-
-
#endif