4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
25 /// This encapsulates a single slice of a document iterator as used e.g.
28 // After IU, the distinction of MathInset and UpdatableInset as well as
29 // that of MathArray and LyXText should vanish. They are conceptually the
34 /// type for cell number in inset
35 typedef size_t idx_type;
36 /// type for paragraph numbers positions within a cell
37 typedef size_t par_type;
38 /// type for cursor positions within a cell
39 typedef size_t pos_type;
44 explicit CursorSlice(InsetBase *);
47 /// texted specific stuff
50 LyXText * text() const;
52 UpdatableInset * asUpdatableInset() const;
55 /// mathed specific stuff
57 /// returns cell corresponding to this position
58 MathArray & cell() const;
59 /// returns cell corresponding to this position
60 MathArray & cell(idx_type idx) const;
61 /// gets screen position of the thing
62 void getPos(int & x, int & y) const;
66 MathInset * asMathInset() const;
69 friend std::ostream & operator<<(std::ostream &, CursorSlice const &);
71 /// pointer to an inset
73 /// cell index of a position in this inset
75 /// paragraph in this cell (used by texted)
77 /// position in this cell
82 bool operator==(CursorSlice const &, CursorSlice const &);
83 /// test for inequality
84 bool operator!=(CursorSlice const &, CursorSlice const &);
86 bool operator<(CursorSlice const &, CursorSlice const &);