3 * Copyright 1995-2002 the LyX Team
4 * Read the file COPYING
7 * \author John Levon <moz@compsoc.man.ac.uk>
13 #pragma implementation
16 #include "BufferView.h"
17 #include "BufferView_pimpl.h"
19 #include "frontends/screen.h"
20 #include "frontends/WorkArea.h"
21 #include "frontends/LyXView.h"
24 BufferView::BufferView(LyXView * owner, int xpos, int ypos,
25 int width, int height)
26 : pimpl_(new Pimpl(this, owner, xpos, ypos, width, height))
32 BufferView::~BufferView()
39 Buffer * BufferView::buffer() const
41 return pimpl_->buffer_;
45 LyXScreen & BufferView::screen() const
47 return pimpl_->screen();
51 WorkArea & BufferView::workarea() const
53 return pimpl_->workarea();
57 LyXView * BufferView::owner() const
59 return pimpl_->owner_;
63 Painter & BufferView::painter() const
65 return pimpl_->painter();
69 void BufferView::buffer(Buffer * b)
75 void BufferView::resize()
77 if (pimpl_->buffer_) {
78 pimpl_->resizeCurrentBuffer();
83 void BufferView::repaint()
89 bool BufferView::fitCursor()
91 return pimpl_->fitCursor();
95 void BufferView::update()
101 void BufferView::updateScrollbar()
103 pimpl_->updateScrollbar();
107 void BufferView::scrollDocView(int value)
109 pimpl_->scrollDocView(value);
113 void BufferView::redoCurrentBuffer()
115 pimpl_->redoCurrentBuffer();
119 bool BufferView::available() const
121 return pimpl_->available();
125 void BufferView::beforeChange(LyXText * text)
127 pimpl_->beforeChange(text);
131 void BufferView::savePosition(unsigned int i)
133 pimpl_->savePosition(i);
137 void BufferView::restorePosition(unsigned int i)
139 pimpl_->restorePosition(i);
143 bool BufferView::isSavedPosition(unsigned int i)
145 return pimpl_->isSavedPosition(i);
149 void BufferView::update(LyXText * text, UpdateCodes f)
151 pimpl_->update(text, f);
155 void BufferView::switchKeyMap()
157 pimpl_->switchKeyMap();
161 void BufferView::insetUnlock()
163 pimpl_->insetUnlock();
167 int BufferView::workWidth() const
169 return pimpl_->workarea().workWidth();
173 void BufferView::showCursor()
175 pimpl_->showCursor();
179 void BufferView::hideCursor()
181 pimpl_->hideCursor();
185 void BufferView::toggleSelection(bool b)
187 pimpl_->toggleSelection(b);
191 void BufferView::toggleToggle()
193 pimpl_->toggleToggle();
197 void BufferView::center()
203 string const BufferView::getClipboard() const
205 return pimpl_->workarea().getClipboard();
209 void BufferView::stuffClipboard(string const & stuff) const
211 pimpl_->stuffClipboard(stuff);
215 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
216 BufferView::UpdateCodes uc2)
218 return static_cast<BufferView::UpdateCodes>
219 (static_cast<int>(uc1) | static_cast<int>(uc2));
223 bool BufferView::dispatch(FuncRequest const & ev)
225 return pimpl_->dispatch(ev);
229 int BufferView::scroll(long time)
231 return pimpl_->scroll(time);