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.
15 #include "textcursor.h"
16 #include "cursor_slice.h"
18 #include "support/types.h"
32 * The cursor class describes the position of a cursor within a document.
38 /// create 'empty' cursor
39 explicit LCursor(BufferView * bv);
40 /// dispatch from innermost inset upwards
41 DispatchResult dispatch(FuncRequest const & cmd);
43 void push(UpdatableInset * inset);
44 /// restrict cursor nesting to given size
46 /// pop one level off the cursor
48 /// access to cursor 'tip'
49 CursorSlice & top() { return data_.back(); }
50 /// access to cursor 'tip'
51 CursorSlice const & top() const { return data_.back(); }
53 /// set the cell the cursor is in
55 /// return the cell this cursor is in
58 UpdatableInset * innerInset() const;
60 UpdatableInset * innerInsetOfType(int code) const;
62 InsetTabular * innerInsetTabular() const;
64 LyXText * innerText() const;
65 /// returns x,y position
66 void getPos(int & x, int & y) const;
67 /// returns cursor dimension
68 void getDim(int & asc, int & desc) const;
69 /// cache the absolute coordinate from the top inset
72 friend std::ostream & operator<<(std::ostream &, LCursor const &);
74 /// mainly used as stack, but wee need random access
75 std::vector<CursorSlice> data_;