]> git.lyx.org Git - lyx.git/blob - src/cursor.h
ws changes only
[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 <vector>
21
22 class BufferView;
23 class DispatchResult;
24 class FuncRequest;
25 class LyXText;
26
27
28 /**
29  * The cursor class describes the position of a cursor within a document.
30  */
31
32 class CursorItem : public TextCursor {
33 public:
34         ///
35         CursorItem() : text_(0) {}
36 public:
37         ///
38         LyXText * text_;
39         ///
40         ParagraphList::iterator pit_;
41         ///
42         int pos_;
43 };
44
45
46 class Cursor {
47 public:
48         ///
49         Cursor() {}
50         ///
51         DispatchResult dispatch(FuncRequest const & cmd);
52 public:
53         /// mainly used as stack, bnut wee need random access
54         std::vector<CursorItem> data_;
55 };
56
57 /// build cursor from current cursor in view
58 void buildCursor(Cursor & cursor, BufferView & bv);
59
60 /// build cursor from (x,y) coordinates
61 void buildCursor(Cursor & cursor, BufferView & bv, int x, int y);
62
63 #endif // LYXCURSOR_H