]> git.lyx.org Git - lyx.git/blob - src/BufferView_pimpl.h
Added splash for qt2 frontend, Edwin
[lyx.git] / src / BufferView_pimpl.h
1 // -*- C++ -*-
2
3 #ifndef BUFFERVIEW_PIMPL_H
4 #define BUFFERVIEW_PIMPL_H
5
6 #include <boost/smart_ptr.hpp>
7
8 #include "BufferView.h"
9 #include "UpdateInset.h"
10 #include "commandtags.h"
11 #include "frontends/Timeout.h"
12 #include "WorkArea.h"
13
14 #ifdef __GNUG__
15 #pragma interface
16 #endif
17
18 class LyXView;
19 class WorkArea;
20 class LyXScreen;
21
22 #ifdef SIGC_CXX_NAMESPACES
23 using SigC::Object;
24 #endif
25
26 ///
27 struct BufferView::Pimpl : public Object {
28         ///
29         Pimpl(BufferView * i, LyXView * o,
30               int xpos, int ypos, int width, int height);
31         ///
32         Painter & painter();
33         ///
34         void buffer(Buffer *);
35         ///
36         void resize(int xpos, int ypos, int width, int height);
37         ///
38         void resize();
39         ///
40         void redraw();
41         /// Return true if the cursor was fitted.
42         bool fitCursor(LyXText *);
43         ///
44         void redoCurrentBuffer();
45         ///
46         int resizeCurrentBuffer();
47         ///
48         void update();
49         //
50         void update(LyXText *, BufferView::UpdateCodes);
51         /// Update pixmap of screen
52         void updateScreen();
53         ///
54         void workAreaExpose();
55         ///
56         void updateScrollbar();
57         ///
58         void scrollCB(double value);
59         ///
60         Inset * checkInsetHit(LyXText *, int & x, int & y,
61                               unsigned int button);
62         /// 
63         int scrollUp(long time);
64         ///
65         int scrollDown(long time);
66         ///
67         void workAreaKeyPress(KeySym, unsigned int state);
68         ///
69         void workAreaMotionNotify(int x, int y, unsigned int state);
70         ///
71         void workAreaButtonPress(int x, int y, unsigned int button);
72         ///
73         void workAreaButtonRelease(int x, int y, unsigned int button);
74         ///
75         void doubleClick(int x, int y, unsigned int button);
76         ///
77         void tripleClick(int x, int y, unsigned int button);
78         ///
79         void enterView();
80         ///
81         void leaveView();
82         ///
83         void cursorToggle();
84         ///
85         void cursorPrevious(LyXText *);
86         ///
87         void cursorNext(LyXText *);
88         ///
89         bool available() const;
90         ///
91         void beforeChange(LyXText *);
92         ///
93         void savePosition(unsigned int i);
94         ///
95         void restorePosition(unsigned int i);
96         ///
97         bool isSavedPosition(unsigned int i);
98         ///
99         void setState();
100         ///
101         void insetSleep();
102         ///
103         void insetWakeup();
104         ///
105         void insetUnlock();
106         ///
107         bool focus() const;
108         ///
109         void focus(bool);
110         ///
111         bool active() const;
112         ///
113         bool belowMouse() const;
114         ///
115         void showCursor();
116         ///
117         void hideCursor();
118         ///
119         void toggleSelection(bool = true);
120         ///
121         void toggleToggle();
122         ///
123         void center();
124         ///
125         bool Dispatch(kb_action action, string const & argument);
126 private:
127         ///
128         friend class BufferView;
129         
130         ///
131         BufferView * bv_;
132         ///
133         LyXView * owner_;
134         ///
135         Buffer * buffer_;
136         ///
137         boost::scoped_ptr<LyXScreen> screen_;
138         ///
139         long current_scrollbar_value;
140         ///
141         FL_OBJECT * figinset_canvas;
142         ///
143         Timeout cursor_timeout;
144         ///
145         int last_click_x;
146         ///
147         int last_click_y;
148         ///
149         WorkArea workarea_;
150         ///
151         UpdateInset updatelist;
152         ///
153         void pasteClipboard(bool asPara);
154         ///
155         void stuffClipboard(string const &) const;
156         ///
157         bool using_xterm_cursor;
158         ///
159         struct Position {
160                 /// Filename
161                 string filename;
162                 /// Cursor paragraph Id
163                 int par_id;
164                 /// Cursor position
165                 LyXParagraph::size_type par_pos;
166                 ///
167                 Position() : par_id(0), par_pos(0) {}
168                 ///
169                 Position(string const & f, int id, LyXParagraph::size_type pos)
170                         : filename(f), par_id(id), par_pos(pos) {}
171         };
172         ///
173         std::vector<Position> saved_positions;
174         ///
175         void moveCursorUpdate(bool selecting);
176         /// Get next inset of this class from current cursor position  
177         Inset * getInsetByCode(Inset::Code code);
178         ///
179         void MenuInsertLyXFile(string const & filen);
180 };
181 #endif