3 * \file BufferView_pimpl.h
4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
10 #ifndef BUFFERVIEW_PIMPL_H
11 #define BUFFERVIEW_PIMPL_H
13 #include "BufferView.h"
14 #include "frontends/Timeout.h"
15 #include "frontends/key_state.h"
16 #include "frontends/LyXKeySym.h"
17 #include "support/types.h"
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/signals/trackable.hpp>
30 struct BufferView::Pimpl : public boost::signals::trackable {
32 Pimpl(BufferView * i, LyXView * o,
33 int xpos, int ypos, int width, int height);
35 Painter & painter() const;
36 /// return the screen for this bview
37 LyXScreen & screen() const;
39 void buffer(Buffer *);
40 /// Return true if the cursor was fitted.
43 void redoCurrentBuffer();
45 int resizeCurrentBuffer();
49 void update(LyXText *, BufferView::UpdateCodes);
50 /// update the toplevel lyx text
51 void update(BufferView::UpdateCodes);
53 * Repaint pixmap. Used for when we've made a visible
54 * change but don't need the full update() logic
58 void workAreaResize();
60 void updateScrollbar();
62 void scrollDocView(int value);
64 * Wheel mouse scroll, move by multiples of text->defaultRowHeight().
66 void scroll(int lines);
68 void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
70 void selectionRequested();
76 bool available() const;
77 /// get the change at the cursor position
78 Change const getCurrentChange();
80 void beforeChange(LyXText *);
82 void savePosition(unsigned int i);
84 void restorePosition(unsigned int i);
86 bool isSavedPosition(unsigned int i);
92 void toggleSelection(bool = true);
98 bool insertInset(Inset * inset, string const & lout = string());
100 void updateInset(Inset * inset);
101 /// a function should be executed from the workarea
102 bool workAreaDispatch(FuncRequest const & ev);
103 /// a function should be executed
104 bool dispatch(FuncRequest const & ev);
106 /// track changes for the document
110 friend class BufferView;
119 boost::scoped_ptr<LyXScreen> screen_;
121 boost::scoped_ptr<WorkArea> workarea_;
123 Timeout cursor_timeout;
125 void stuffClipboard(string const &) const;
127 bool using_xterm_cursor;
132 /// Cursor paragraph Id
135 lyx::pos_type par_pos;
137 Position() : par_id(0), par_pos(0) {}
139 Position(string const & f, int id, lyx::pos_type pos)
140 : filename(f), par_id(id), par_pos(pos) {}
143 std::vector<Position> saved_positions;
144 /// Get next inset of this class from current cursor position
145 Inset * getInsetByCode(Inset::Code code);
147 void MenuInsertLyXFile(string const & filen);
149 WorkArea & workarea() const;
151 #endif // BUFFERVIEW_PIMPL_H