3 #ifndef BUFFERVIEW_PIMPL_H
4 #define BUFFERVIEW_PIMPL_H
6 #include <boost/smart_ptr.hpp>
8 #include "BufferView.h"
9 #include "UpdateInset.h"
10 #include "commandtags.h"
11 #include "frontends/Timeout.h"
13 #include "insets/insetspecialchar.h"
14 #include "support/types.h"
25 struct BufferView::Pimpl : public SigC::Object {
27 Pimpl(BufferView * i, LyXView * o,
28 int xpos, int ypos, int width, int height);
32 void buffer(Buffer *);
34 void resize(int xpos, int ypos, int width, int height);
39 /// Return true if the cursor was fitted.
42 void redoCurrentBuffer();
44 int resizeCurrentBuffer();
48 void update(LyXText *, BufferView::UpdateCodes);
49 /// Update pixmap of screen
52 void workAreaExpose();
54 void updateScrollbar();
56 void scrollCB(double value);
58 Inset * checkInsetHit(LyXText *, int & x, int & y,
61 int scrollUp(long time);
63 int scrollDown(long time);
65 void workAreaKeyPress(KeySym, unsigned int state);
67 void workAreaMotionNotify(int x, int y, unsigned int state);
69 void workAreaButtonPress(int x, int y, unsigned int button);
71 void workAreaButtonRelease(int x, int y, unsigned int button);
73 void doubleClick(int x, int y, unsigned int button);
75 void tripleClick(int x, int y, unsigned int button);
83 void cursorPrevious(LyXText *);
85 void cursorNext(LyXText *);
87 bool available() const;
89 void beforeChange(LyXText *);
91 void savePosition(unsigned int i);
93 void restorePosition(unsigned int i);
95 bool isSavedPosition(unsigned int i);
111 bool belowMouse() const;
117 void toggleSelection(bool = true);
123 bool insertInset(Inset * inset, string const & lout = string());
125 void updateInset(Inset * inset, bool mark_dirty);
127 bool Dispatch(kb_action action, string const & argument);
130 friend class BufferView;
131 /// open and lock an updatable inset
132 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
134 void protectedBlank(LyXText * lt);
136 void specialChar(InsetSpecialChar::Kind);
144 void insertAndEditInset(Inset *);
146 void gotoInset(std::vector<Inset::Code> const & codes,
149 void gotoInset(Inset::Code codes, bool same_content);
157 boost::scoped_ptr<LyXScreen> screen_;
159 long current_scrollbar_value;
161 Timeout cursor_timeout;
165 UpdateInset updatelist;
167 void pasteClipboard(bool asPara);
169 void stuffClipboard(string const &) const;
171 bool using_xterm_cursor;
176 /// Cursor paragraph Id
179 lyx::pos_type par_pos;
181 Position() : par_id(0), par_pos(0) {}
183 Position(string const & f, int id, lyx::pos_type pos)
184 : filename(f), par_id(id), par_pos(pos) {}
187 std::vector<Position> saved_positions;
189 void moveCursorUpdate(bool selecting);
190 /// Get next inset of this class from current cursor position
191 Inset * getInsetByCode(Inset::Code code);
193 void MenuInsertLyXFile(string const & filen);