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 {
26 /// position in a paragraph
27 typedef lyx::pos_type pos_type;
29 Pimpl(BufferView * i, LyXView * o,
30 int xpos, int ypos, int width, int height);
34 void buffer(Buffer *);
36 void resize(int xpos, int ypos, int width, int height);
41 /// Return true if the cursor was fitted.
44 void redoCurrentBuffer();
46 int resizeCurrentBuffer();
50 void update(LyXText *, BufferView::UpdateCodes);
51 /// Update pixmap of screen
54 void workAreaExpose();
56 void updateScrollbar();
58 void scrollCB(double value);
60 Inset * checkInsetHit(LyXText *, int & x, int & y,
63 int scrollUp(long time);
65 int scrollDown(long time);
67 void workAreaKeyPress(KeySym, unsigned int state);
69 void workAreaMotionNotify(int x, int y, unsigned int state);
71 void workAreaButtonPress(int x, int y, unsigned int button);
73 void workAreaButtonRelease(int x, int y, unsigned int button);
75 void doubleClick(int x, int y, unsigned int button);
77 void tripleClick(int x, int y, unsigned int button);
85 void cursorPrevious(LyXText *);
87 void cursorNext(LyXText *);
89 bool available() const;
91 void beforeChange(LyXText *);
93 void savePosition(unsigned int i);
95 void restorePosition(unsigned int i);
97 bool isSavedPosition(unsigned int i);
113 bool belowMouse() const;
119 void toggleSelection(bool = true);
125 bool insertInset(Inset * inset, string const & lout = string());
127 void updateInset(Inset * inset, bool mark_dirty);
129 bool Dispatch(kb_action action, string const & argument);
132 friend class BufferView;
133 /// open and lock an updatable inset
134 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
136 void protectedBlank(LyXText * lt);
138 void specialChar(InsetSpecialChar::Kind);
146 void insertAndEditInset(Inset *);
148 void gotoInset(std::vector<Inset::Code> const & codes,
151 void gotoInset(Inset::Code codes, bool same_content);
159 boost::scoped_ptr<LyXScreen> screen_;
161 long current_scrollbar_value;
163 Timeout cursor_timeout;
167 UpdateInset updatelist;
169 void pasteClipboard(bool asPara);
171 void stuffClipboard(string const &) const;
173 bool using_xterm_cursor;
178 /// Cursor paragraph Id
183 Position() : par_id(0), par_pos(0) {}
185 Position(string const & f, int id, pos_type pos)
186 : filename(f), par_id(id), par_pos(pos) {}
189 std::vector<Position> saved_positions;
191 void moveCursorUpdate(bool selecting);
192 /// Get next inset of this class from current cursor position
193 Inset * getInsetByCode(Inset::Code code);
195 void MenuInsertLyXFile(string const & filen);