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"
23 BufferView::BufferView(LyXView * o, int xpos, int ypos,
24 int width, int height)
25 : pimpl_(new Pimpl(this, o, xpos, ypos, width, height))
31 BufferView::~BufferView()
38 Buffer * BufferView::buffer() const
40 return pimpl_->buffer_;
44 LyXScreen & BufferView::screen() const
46 return pimpl_->screen();
50 LyXView * BufferView::owner() const
52 return pimpl_->owner_;
56 Painter & BufferView::painter() const
58 return pimpl_->painter();
62 void BufferView::buffer(Buffer * b)
68 void BufferView::resize()
70 if (pimpl_->buffer_) {
71 pimpl_->resizeCurrentBuffer();
76 void BufferView::repaint()
82 bool BufferView::fitCursor()
84 return pimpl_->fitCursor();
88 void BufferView::update()
94 void BufferView::updateScrollbar()
96 pimpl_->updateScrollbar();
100 void BufferView::scrollDocView(int value)
102 pimpl_->scrollDocView(value);
106 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
108 return pimpl_->checkInsetHit(text, x, y);
112 void BufferView::redoCurrentBuffer()
114 pimpl_->redoCurrentBuffer();
118 void BufferView::cursorPrevious(LyXText * text)
120 pimpl_->cursorPrevious(text);
124 void BufferView::cursorNext(LyXText * text)
126 pimpl_->cursorNext(text);
130 bool BufferView::available() const
132 return pimpl_->available();
136 void BufferView::beforeChange(LyXText * text)
138 pimpl_->beforeChange(text);
142 void BufferView::savePosition(unsigned int i)
144 pimpl_->savePosition(i);
148 void BufferView::restorePosition(unsigned int i)
150 pimpl_->restorePosition(i);
154 bool BufferView::isSavedPosition(unsigned int i)
156 return pimpl_->isSavedPosition(i);
160 void BufferView::update(LyXText * text, UpdateCodes f)
162 pimpl_->update(text, f);
166 void BufferView::setState()
172 void BufferView::insetUnlock()
174 pimpl_->insetUnlock();
178 int BufferView::workWidth() const
180 return pimpl_->workarea().workWidth();
184 void BufferView::showCursor()
186 pimpl_->showCursor();
190 void BufferView::hideCursor()
192 pimpl_->hideCursor();
196 void BufferView::toggleSelection(bool b)
198 pimpl_->toggleSelection(b);
202 void BufferView::toggleToggle()
204 pimpl_->toggleToggle();
208 void BufferView::center()
214 void BufferView::pasteClipboard(bool asPara)
216 pimpl_->pasteClipboard(asPara);
220 string const BufferView::getClipboard() const
222 return pimpl_->workarea().getClipboard();
226 void BufferView::stuffClipboard(string const & stuff) const
228 pimpl_->stuffClipboard(stuff);
232 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
233 BufferView::UpdateCodes uc2)
235 return static_cast<BufferView::UpdateCodes>
236 (static_cast<int>(uc1) | static_cast<int>(uc2));
239 bool BufferView::Dispatch(kb_action action, string const & argument)
241 return pimpl_->Dispatch(action, argument);