]> git.lyx.org Git - lyx.git/blob - src/cursor.h
preliminary 'global cursor' stuff
[lyx.git] / src / cursor.h
1 // -*- C++ -*-
2 /**
3  * \file cursor.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author André Pönitz
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CURSOR_H
13 #define CURSOR_H
14
15 #include "ParagraphList_fwd.h"
16 #include "textcursor.h"
17
18 #include "support/types.h"
19
20 #include "insets/insetbase.h"
21
22 #include <vector>
23
24 class LyXText;
25
26
27 /**
28  * The cursor class describes the position of a cursor within a document.
29  */
30
31 class CursorItem : public TextCursor {
32 public:
33         ///
34         CursorItem() : text_(0) {}
35 public:
36         ///
37         LyXText * text_;
38         ///
39         ParagraphList::iterator pit_;
40         ///
41         int pos_;
42 };
43
44
45 class Cursor {
46 public:
47         ///
48         Cursor() {}
49         ///
50         dispatch_result dispatch(FuncRequest const & cmd);
51 public:
52         /// mainly used as stack, bnut wee need random access
53         std::vector<CursorItem> data_;
54 };
55
56 /// build cursor from current cursor in view
57 void buildCursor(Cursor & cursor, BufferView & bv);
58
59 /// build cursor from (x,y) coordinates
60 void buildCursor(Cursor & cursor, BufferView & bv, int x, int y);
61
62 #endif // LYXCURSOR_H