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 "errorlist.h"
14 #include "BufferView.h"
15 #include "frontends/Timeout.h"
16 #include "frontends/key_state.h"
17 #include "frontends/LyXKeySym.h"
18 #include "support/types.h"
20 #include <boost/scoped_ptr.hpp>
21 #include <boost/signals/trackable.hpp>
31 struct BufferView::Pimpl : public boost::signals::trackable {
33 Pimpl(BufferView * i, LyXView * o,
34 int xpos, int ypos, int width, int height);
36 Painter & painter() const;
37 /// return the screen for this bview
38 LyXScreen & screen() const;
40 void buffer(Buffer *);
41 /// Return true if the cursor was fitted.
44 void redoCurrentBuffer();
46 int resizeCurrentBuffer();
50 void update(LyXText *, BufferView::UpdateCodes);
51 /// update the toplevel lyx text
52 void update(BufferView::UpdateCodes);
54 * Repaint pixmap. Used for when we've made a visible
55 * change but don't need the full update() logic
58 bool loadLyXFile(string const &, bool);
62 void workAreaResize();
64 void updateScrollbar();
66 void scrollDocView(int value);
68 * Wheel mouse scroll, move by multiples of text->defaultRowHeight().
70 void scroll(int lines);
72 void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
74 void selectionRequested();
80 bool available() const;
81 /// get the change at the cursor position
82 Change const getCurrentChange();
84 void beforeChange(LyXText *);
86 void savePosition(unsigned int i);
88 void restorePosition(unsigned int i);
90 bool isSavedPosition(unsigned int i);
96 void toggleSelection(bool = true);
102 bool insertInset(Inset * inset, string const & lout = string());
104 void updateInset(Inset * inset);
105 /// a function should be executed from the workarea
106 bool workAreaDispatch(FuncRequest const & ev);
107 /// a function should be executed
108 bool dispatch(FuncRequest const & ev);
110 /// An error list (replaces the error insets)
111 ErrorList errorlist_;
113 /// track changes for the document
117 friend class BufferView;
126 boost::scoped_ptr<LyXScreen> screen_;
128 boost::scoped_ptr<WorkArea> workarea_;
130 Timeout cursor_timeout;
132 void stuffClipboard(string const &) const;
134 bool using_xterm_cursor;
139 /// Cursor paragraph Id
142 lyx::pos_type par_pos;
144 Position() : par_id(0), par_pos(0) {}
146 Position(string const & f, int id, lyx::pos_type pos)
147 : filename(f), par_id(id), par_pos(pos) {}
150 std::vector<Position> saved_positions;
151 /// Get next inset of this class from current cursor position
152 Inset * getInsetByCode(Inset::Code code);
154 void MenuInsertLyXFile(string const & filen);
156 WorkArea & workarea() const;
158 #endif // BUFFERVIEW_PIMPL_H