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 pimpl_->resizeCurrentBuffer();
74 void BufferView::repaint()
80 bool BufferView::fitCursor()
82 return pimpl_->fitCursor();
86 void BufferView::update()
92 void BufferView::updateScrollbar()
94 pimpl_->updateScrollbar();
98 void BufferView::scrollDocView(int value)
100 pimpl_->scrollDocView(value);
104 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
106 return pimpl_->checkInsetHit(text, x, y);
110 void BufferView::redoCurrentBuffer()
112 pimpl_->redoCurrentBuffer();
116 void BufferView::cursorPrevious(LyXText * text)
118 pimpl_->cursorPrevious(text);
122 void BufferView::cursorNext(LyXText * text)
124 pimpl_->cursorNext(text);
128 bool BufferView::available() const
130 return pimpl_->available();
134 void BufferView::beforeChange(LyXText * text)
136 pimpl_->beforeChange(text);
140 void BufferView::savePosition(unsigned int i)
142 pimpl_->savePosition(i);
146 void BufferView::restorePosition(unsigned int i)
148 pimpl_->restorePosition(i);
152 bool BufferView::isSavedPosition(unsigned int i)
154 return pimpl_->isSavedPosition(i);
158 void BufferView::update(LyXText * text, UpdateCodes f)
160 pimpl_->update(text, f);
164 void BufferView::setState()
170 void BufferView::insetUnlock()
172 pimpl_->insetUnlock();
176 int BufferView::workWidth() const
178 return pimpl_->workarea().workWidth();
182 void BufferView::showCursor()
184 pimpl_->showCursor();
188 void BufferView::hideCursor()
190 pimpl_->hideCursor();
194 void BufferView::toggleSelection(bool b)
196 pimpl_->toggleSelection(b);
200 void BufferView::toggleToggle()
202 pimpl_->toggleToggle();
206 void BufferView::center()
212 void BufferView::pasteClipboard(bool asPara)
214 pimpl_->pasteClipboard(asPara);
218 string const BufferView::getClipboard() const
220 return pimpl_->workarea().getClipboard();
224 void BufferView::stuffClipboard(string const & stuff) const
226 pimpl_->stuffClipboard(stuff);
230 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
231 BufferView::UpdateCodes uc2)
233 return static_cast<BufferView::UpdateCodes>
234 (static_cast<int>(uc1) | static_cast<int>(uc2));
237 bool BufferView::Dispatch(kb_action action, string const & argument)
239 return pimpl_->Dispatch(action, argument);