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"
23 struct BufferView::Pimpl : public SigC::Object {
25 Pimpl(BufferView * i, LyXView * o,
26 int xpos, int ypos, int width, int height);
30 void buffer(Buffer *);
32 void resize(int xpos, int ypos, int width, int height);
37 /// Return true if the cursor was fitted.
38 bool fitCursor(LyXText *);
40 void redoCurrentBuffer();
42 int resizeCurrentBuffer();
46 void update(LyXText *, BufferView::UpdateCodes);
47 /// Update pixmap of screen
50 void workAreaExpose();
52 void updateScrollbar();
54 void scrollCB(double value);
56 Inset * checkInsetHit(LyXText *, int & x, int & y,
59 int scrollUp(long time);
61 int scrollDown(long time);
63 void workAreaKeyPress(KeySym, unsigned int state);
65 void workAreaMotionNotify(int x, int y, unsigned int state);
67 void workAreaButtonPress(int x, int y, unsigned int button);
69 void workAreaButtonRelease(int x, int y, unsigned int button);
71 void doubleClick(int x, int y, unsigned int button);
73 void tripleClick(int x, int y, unsigned int button);
81 void cursorPrevious(LyXText *);
83 void cursorNext(LyXText *);
85 bool available() const;
87 void beforeChange(LyXText *);
89 void savePosition(unsigned int i);
91 void restorePosition(unsigned int i);
93 bool isSavedPosition(unsigned int i);
109 bool belowMouse() const;
115 void toggleSelection(bool = true);
121 bool insertInset(Inset * inset, string const & lout = string());
123 void updateInset(Inset * inset, bool mark_dirty);
125 bool Dispatch(kb_action action, string const & argument);
128 friend class BufferView;
129 /// open and lock an updatable inset
130 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
132 void protectedBlank(LyXText * lt);
138 void menuSeparator();
140 void endOfSentenceDot();
144 void hyphenationPoint();
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
181 LyXParagraph::size_type par_pos;
183 Position() : par_id(0), par_pos(0) {}
185 Position(string const & f, int id, LyXParagraph::size_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);