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"
30 * The cursor class describes the position of a cursor within a document.
36 CursorItem() : inset_(0), par_(0), pos_(0) {}
38 explicit CursorItem(UpdatableInset * inset)
39 : inset_(inset), par_(0), pos_(0)
42 LyXText * text() const;
44 friend std::ostream & operator<<(std::ostream &, CursorItem const &);
47 UpdatableInset * inset_;
57 /// create 'empty' cursor
58 explicit LCursor(BufferView * bv);
59 /// dispatch from innermost inset upwards
60 DispatchResult dispatch(FuncRequest const & cmd);
62 void push(UpdatableInset * inset);
63 /// restrict cursor nesting to given size
65 /// pop one level off the cursor
68 UpdatableInset * innerInset() const;
70 UpdatableInset * innerInsetOfType(int code) const;
72 InsetTabular * innerInsetTabular() const;
74 LyXText * innerText() const;
75 /// returns x,y position
76 void getPos(int & x, int & y) const;
78 friend std::ostream & operator<<(std::ostream &, LCursor const &);
80 /// mainly used as stack, but wee need random access
81 std::vector<CursorItem> data_;