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(int xpos, int ypos, int width, int height)
70 pimpl_->resize(xpos, ypos, width, height);
74 void BufferView::resize()
80 void BufferView::redraw()
86 bool BufferView::fitCursor()
88 return pimpl_->fitCursor();
92 void BufferView::update()
98 void BufferView::updateScrollbar()
100 pimpl_->updateScrollbar();
104 void BufferView::scrollDocView(int value)
106 pimpl_->scrollDocView(value);
110 Inset * BufferView::checkInsetHit(LyXText * text, int & x, int & y)
112 return pimpl_->checkInsetHit(text, x, y);
116 void BufferView::redoCurrentBuffer()
118 pimpl_->redoCurrentBuffer();
122 int BufferView::resizeCurrentBuffer()
124 return pimpl_->resizeCurrentBuffer();
128 void BufferView::cursorPrevious(LyXText * text)
130 pimpl_->cursorPrevious(text);
134 void BufferView::cursorNext(LyXText * text)
136 pimpl_->cursorNext(text);
140 bool BufferView::available() const
142 return pimpl_->available();
146 void BufferView::beforeChange(LyXText * text)
148 pimpl_->beforeChange(text);
152 void BufferView::savePosition(unsigned int i)
154 pimpl_->savePosition(i);
158 void BufferView::restorePosition(unsigned int i)
160 pimpl_->restorePosition(i);
164 bool BufferView::isSavedPosition(unsigned int i)
166 return pimpl_->isSavedPosition(i);
170 void BufferView::update(LyXText * text, UpdateCodes f)
172 pimpl_->update(text, f);
176 void BufferView::setState()
182 void BufferView::insetUnlock()
184 pimpl_->insetUnlock();
188 bool BufferView::focus() const
190 return pimpl_->focus();
194 void BufferView::focus(bool f)
200 int BufferView::workWidth() const
202 return pimpl_->workarea().workWidth();
206 void BufferView::showCursor()
208 pimpl_->showCursor();
212 void BufferView::hideCursor()
214 pimpl_->hideCursor();
218 void BufferView::toggleSelection(bool b)
220 pimpl_->toggleSelection(b);
224 void BufferView::toggleToggle()
226 pimpl_->toggleToggle();
230 void BufferView::center()
236 void BufferView::pasteClipboard(bool asPara)
238 pimpl_->pasteClipboard(asPara);
242 string const BufferView::getClipboard() const
244 return pimpl_->workarea().getClipboard();
248 void BufferView::stuffClipboard(string const & stuff) const
250 pimpl_->stuffClipboard(stuff);
254 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
255 BufferView::UpdateCodes uc2)
257 return static_cast<BufferView::UpdateCodes>
258 (static_cast<int>(uc1) | static_cast<int>(uc2));
261 bool BufferView::Dispatch(kb_action action, string const & argument)
263 return pimpl_->Dispatch(action, argument);