]> git.lyx.org Git - lyx.git/blob - src/BufferView_pimpl.h
Fix language of error insets
[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 "insets/insetspecialchar.h"
14 #include "support/types.h"
15
16 #ifdef __GNUG__
17 #pragma interface
18 #endif
19
20 class LyXView;
21 class WorkArea;
22 class LyXScreen;
23
24 ///
25 struct BufferView::Pimpl : public SigC::Object {
26         /// position in a paragraph
27         typedef lyx::pos_type pos_type;
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();
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 insertInset(Inset * inset, string const & lout = string());
126         ///
127         void updateInset(Inset * inset, bool mark_dirty);
128         ///
129         bool Dispatch(kb_action action, string const & argument);
130 private:
131         ///
132         friend class BufferView;
133         /// open and lock an updatable inset
134         bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
135         ///
136         void protectedBlank(LyXText * lt);
137         /// 
138         void specialChar(InsetSpecialChar::Kind);
139         ///
140         void newline();
141         ///
142         void hfill();
143         ///
144         void smartQuote();
145         ///
146         void insertAndEditInset(Inset *);
147         ///
148         void gotoInset(std::vector<Inset::Code> const & codes,
149                        bool same_content);
150         ///
151         void gotoInset(Inset::Code codes, bool same_content);
152         ///
153         BufferView * bv_;
154         ///
155         LyXView * owner_;
156         ///
157         Buffer * buffer_;
158         ///
159         boost::scoped_ptr<LyXScreen> screen_;
160         ///
161         long current_scrollbar_value;
162         ///
163         Timeout cursor_timeout;
164         ///
165         WorkArea workarea_;
166         ///
167         UpdateInset updatelist;
168         ///
169         void pasteClipboard(bool asPara);
170         ///
171         void stuffClipboard(string const &) const;
172         ///
173         bool using_xterm_cursor;
174         ///
175         struct Position {
176                 /// Filename
177                 string filename;
178                 /// Cursor paragraph Id
179                 int par_id;
180                 /// Cursor position
181                 pos_type par_pos;
182                 ///
183                 Position() : par_id(0), par_pos(0) {}
184                 ///
185                 Position(string const & f, int id, pos_type pos)
186                         : filename(f), par_id(id), par_pos(pos) {}
187         };
188         ///
189         std::vector<Position> saved_positions;
190         ///
191         void moveCursorUpdate(bool selecting);
192         /// Get next inset of this class from current cursor position  
193         Inset * getInsetByCode(Inset::Code code);
194         ///
195         void MenuInsertLyXFile(string const & filen);
196         ///
197         bool inset_slept;
198 };
199 #endif