]> git.lyx.org Git - lyx.git/blob - src/frontends/GuiCursor.h
This is the merging of the GUI API cleanup branch that was developed in svn+ssh:...
[lyx.git] / src / frontends / GuiCursor.h
1 // -*- C++ -*-
2 /**
3  * \file GuiCursor.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author unknown
8  * \author John Levon
9  * \author Abdelrazak Younes
10  *
11  * Full author contact details are available in file CREDITS.
12  */
13
14 #ifndef GUI_CURSOR_H
15 #define GUI_CURSOR_H
16
17
18 class LyXText;
19 class CursorSlice;
20 class BufferView;
21 class ViewMetricsInfo;
22
23 namespace lyx {
24 namespace frontend {
25
26 class WorkArea;
27
28 /// types of cursor in work area
29 enum Cursor_Shape {
30         /// normal I-beam
31         BAR_SHAPE,
32         /// L-shape for locked insets of a different language
33         L_SHAPE,
34         /// reverse L-shape for RTL text
35         REVERSED_L_SHAPE
36 };
37
38 /**
39  * GuiCursor - document rendering management
40  *
41  * The blinking cursor is handled here.
42  */
43 class GuiCursor {
44 public:
45         GuiCursor();
46
47         virtual ~GuiCursor();
48
49         void connect(WorkArea * work_area);
50
51         /// hide the visible cursor, if it is visible
52         void hide();
53
54         /// show the cursor if it is not visible
55         void show(BufferView & bv);
56
57         /// toggle the cursor's visibility
58         void toggle(BufferView & bv);
59
60         /// set cursor_visible_ to false in prep for re-display
61         void prepare();
62
63 private:
64         /// is the cursor currently displayed
65         bool cursor_visible_;
66
67         WorkArea * work_area_;
68 };
69
70 } // namespace frontend
71 } // namespace lyx
72
73 #endif // GUI_CURSOR_H