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