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"
17 #include "support/types.h"
31 * The cursor class describes the position of a cursor within a document.
37 CursorItem() : inset_(0), idx_(0), par_(0), pos_(0) {}
39 explicit CursorItem(UpdatableInset * inset)
40 : inset_(inset), idx_(0), par_(0), pos_(0)
43 LyXText * text() const;
45 friend std::ostream & operator<<(std::ostream &, CursorItem const &);
48 UpdatableInset * inset_;
60 /// create 'empty' cursor
61 explicit LCursor(BufferView * bv);
62 /// dispatch from innermost inset upwards
63 DispatchResult dispatch(FuncRequest const & cmd);
65 void push(UpdatableInset * inset);
66 /// restrict cursor nesting to given size
68 /// pop one level off the cursor
71 UpdatableInset * innerInset() const;
73 UpdatableInset * innerInsetOfType(int code) const;
75 InsetTabular * innerInsetTabular() const;
77 LyXText * innerText() const;
78 /// returns x,y position
79 void getPos(int & x, int & y) const;
80 /// returns cursor dimension
81 void getDim(int & asc, int & desc) const;
82 /// cache the absolute coordinate from the top inset
85 friend std::ostream & operator<<(std::ostream &, LCursor const &);
87 /// mainly used as stack, but wee need random access
88 std::vector<CursorItem> data_;