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>
32 struct BufferView::Pimpl : public boost::signals::trackable {
34 Pimpl(BufferView * i, LyXView * o,
35 int xpos, int ypos, int width, int height);
37 Painter & painter() const;
38 /// return the screen for this bview
39 LyXScreen & screen() const;
41 void buffer(Buffer *);
42 /// Return true if the cursor was fitted.
45 void redoCurrentBuffer();
47 int resizeCurrentBuffer();
51 void update(LyXText *, 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->defaultHeight().
66 void scroll(int lines);
68 void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
70 void selectionRequested();
76 bool available() const;
78 void beforeChange(LyXText *);
80 void savePosition(unsigned int i);
82 void restorePosition(unsigned int i);
84 bool isSavedPosition(unsigned int i);
94 void toggleSelection(bool = true);
100 bool insertInset(Inset * inset, string const & lout = string());
102 void updateInset(Inset * inset, bool mark_dirty);
104 bool dispatch(FuncRequest const & ev);
107 friend class BufferView;
116 boost::scoped_ptr<LyXScreen> screen_;
118 boost::scoped_ptr<WorkArea> workarea_;
120 Timeout cursor_timeout;
122 void stuffClipboard(string const &) const;
124 bool using_xterm_cursor;
129 /// Cursor paragraph Id
132 lyx::pos_type par_pos;
134 Position() : par_id(0), par_pos(0) {}
136 Position(string const & f, int id, lyx::pos_type pos)
137 : filename(f), par_id(id), par_pos(pos) {}
140 std::vector<Position> saved_positions;
141 /// Get next inset of this class from current cursor position
142 Inset * getInsetByCode(Inset::Code code);
144 void MenuInsertLyXFile(string const & filen);
146 WorkArea & workarea() const;
148 #endif // BUFFERVIEW_PIMPL_H