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 work area for this bview
39 WorkArea & workarea() const;
40 /// return the screen for this bview
41 LyXScreen & screen() const;
43 void buffer(Buffer *);
44 /// Return true if the cursor was fitted.
47 void redoCurrentBuffer();
49 int resizeCurrentBuffer();
53 void update(LyXText *, BufferView::UpdateCodes);
55 * Repaint pixmap. Used for when we've made a visible
56 * change but don't need the full update() logic
60 void workAreaResize();
62 void updateScrollbar();
64 void scrollDocView(int value);
66 * Returns an inset if inset was hit, or 0 if not.
68 * If hit, the coordinates are changed relative to the inset.
70 Inset * checkInsetHit(LyXText *, int & x, int & y);
71 /// wheel mouse scroll
72 int scroll(long time);
74 void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
76 void selectionRequested();
82 bool available() const;
84 void beforeChange(LyXText *);
86 void savePosition(unsigned int i);
88 void restorePosition(unsigned int i);
90 bool isSavedPosition(unsigned int i);
100 void toggleSelection(bool = true);
106 bool insertInset(Inset * inset, string const & lout = string());
108 void updateInset(Inset * inset, bool mark_dirty);
110 bool dispatch(FuncRequest const & ev);
113 friend class BufferView;
122 boost::scoped_ptr<LyXScreen> screen_;
124 boost::scoped_ptr<WorkArea> workarea_;
126 Timeout cursor_timeout;
128 void stuffClipboard(string const &) const;
130 bool using_xterm_cursor;
135 /// Cursor paragraph Id
138 lyx::pos_type par_pos;
140 Position() : par_id(0), par_pos(0) {}
142 Position(string const & f, int id, lyx::pos_type pos)
143 : filename(f), par_id(id), par_pos(pos) {}
146 std::vector<Position> saved_positions;
147 /// Get next inset of this class from current cursor position
148 Inset * getInsetByCode(Inset::Code code);
150 void MenuInsertLyXFile(string const & filen);
152 #endif // BUFFERVIEW_PIMPL_H