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