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 "paragraph.h"
24 struct BufferView::Pimpl : public SigC::Object {
26 Pimpl(BufferView * i, LyXView * o,
27 int xpos, int ypos, int width, int height);
31 void buffer(Buffer *);
33 void resize(int xpos, int ypos, int width, int height);
38 /// Return true if the cursor was fitted.
39 bool fitCursor(LyXText *);
41 void redoCurrentBuffer();
43 int resizeCurrentBuffer();
47 void update(LyXText *, BufferView::UpdateCodes);
48 /// Update pixmap of screen
51 void workAreaExpose();
53 void updateScrollbar();
55 void scrollCB(double value);
57 Inset * checkInsetHit(LyXText *, int & x, int & y,
60 int scrollUp(long time);
62 int scrollDown(long time);
64 void workAreaKeyPress(KeySym, unsigned int state);
66 void workAreaMotionNotify(int x, int y, unsigned int state);
68 void workAreaButtonPress(int x, int y, unsigned int button);
70 void workAreaButtonRelease(int x, int y, unsigned int button);
72 void doubleClick(int x, int y, unsigned int button);
74 void tripleClick(int x, int y, unsigned int button);
82 void cursorPrevious(LyXText *);
84 void cursorNext(LyXText *);
86 bool available() const;
88 void beforeChange(LyXText *);
90 void savePosition(unsigned int i);
92 void restorePosition(unsigned int i);
94 bool isSavedPosition(unsigned int i);
110 bool belowMouse() const;
116 void toggleSelection(bool = true);
122 bool insertInset(Inset * inset, string const & lout = string());
124 void updateInset(Inset * inset, bool mark_dirty);
126 bool Dispatch(kb_action action, string const & argument);
129 friend class BufferView;
130 /// open and lock an updatable inset
131 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
133 void protectedBlank(LyXText * lt);
139 void menuSeparator();
141 void endOfSentenceDot();
145 void hyphenationPoint();
149 void gotoInset(std::vector<Inset::Code> const & codes,
152 void gotoInset(Inset::Code codes, bool same_content);
160 boost::scoped_ptr<LyXScreen> screen_;
162 long current_scrollbar_value;
164 Timeout cursor_timeout;
168 UpdateInset updatelist;
170 void pasteClipboard(bool asPara);
172 void stuffClipboard(string const &) const;
174 bool using_xterm_cursor;
179 /// Cursor paragraph Id
182 Paragraph::size_type par_pos;
184 Position() : par_id(0), par_pos(0) {}
186 Position(string const & f, int id, Paragraph::size_type pos)
187 : filename(f), par_id(id), par_pos(pos) {}
190 std::vector<Position> saved_positions;
192 void moveCursorUpdate(bool selecting);
193 /// Get next inset of this class from current cursor position
194 Inset * getInsetByCode(Inset::Code code);
196 void MenuInsertLyXFile(string const & filen);