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
59 void workAreaResize();
61 void updateScrollbar();
63 void scrollDocView(int value);
65 * Wheel mouse scroll, move by multiples of text->defaultRowHeight().
67 void scroll(int lines);
69 void workAreaKeyPress(LyXKeySymPtr key, key_modifier::state state);
71 void selectionRequested();
77 bool available() const;
78 /// get the change at the cursor position
79 Change const getCurrentChange();
81 void beforeChange(LyXText *);
83 void savePosition(unsigned int i);
85 void restorePosition(unsigned int i);
87 bool isSavedPosition(unsigned int i);
93 void toggleSelection(bool = true);
99 bool insertInset(Inset * inset, string const & lout = string());
101 void updateInset(Inset * inset);
102 /// a function should be executed from the workarea
103 bool workAreaDispatch(FuncRequest const & ev);
104 /// a function should be executed
105 bool dispatch(FuncRequest const & ev);
107 /// An error list (replaces the error insets)
108 ErrorList errorlist_;
110 /// track changes for the document
114 friend class BufferView;
123 boost::scoped_ptr<LyXScreen> screen_;
125 boost::scoped_ptr<WorkArea> workarea_;
127 Timeout cursor_timeout;
129 void stuffClipboard(string const &) const;
131 bool using_xterm_cursor;
136 /// Cursor paragraph Id
139 lyx::pos_type par_pos;
141 Position() : par_id(0), par_pos(0) {}
143 Position(string const & f, int id, lyx::pos_type pos)
144 : filename(f), par_id(id), par_pos(pos) {}
147 std::vector<Position> saved_positions;
148 /// Get next inset of this class from current cursor position
149 Inset * getInsetByCode(Inset::Code code);
151 void MenuInsertLyXFile(string const & filen);
153 WorkArea & workarea() const;
155 #endif // BUFFERVIEW_PIMPL_H