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>
33 struct BufferView::Pimpl : public boost::signals::trackable {
35 Pimpl(BufferView * i, LyXView * o,
36 int xpos, int ypos, int width, int height);
38 Painter & painter() const;
39 /// return the screen for this bview
40 LyXScreen & screen() const;
42 void buffer(Buffer *);
43 /// Return true if the cursor was fitted.
46 void redoCurrentBuffer();
48 int resizeCurrentBuffer();
52 void update(LyXText *, 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->defaultHeight().
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);
97 void toggleSelection(bool = true);
103 bool insertInset(Inset * inset, string const & lout = string());
105 void updateInset(Inset * inset, bool mark_dirty);
107 bool dispatch(FuncRequest const & ev);
109 /// track changes for the document
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 WorkArea & workarea() const;
154 #endif // BUFFERVIEW_PIMPL_H