4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Lars Gullik Bjønnes
20 #include "insets/inset.h"
22 #include <boost/utility.hpp>
36 class BufferView : boost::noncopyable {
51 BufferView(LyXView * owner, int , int , int, int);
55 Buffer * buffer() const;
57 Painter & painter() const;
59 LyXScreen & screen() const;
60 /// return the work area for this bview
61 WorkArea & workarea() const;
63 void buffer(Buffer * b);
67 * Repaint the pixmap. Used for when we don't want
68 * to go through the full update() logic, just a simple
69 * repaint of the whole screen.
77 void update(LyXText *, UpdateCodes uc);
79 void updateScrollbar();
81 Inset * checkInsetHit(LyXText *, int & x, int & y);
83 void redoCurrentBuffer();
85 void cursorPrevious(LyXText *);
87 void cursorNext(LyXText *);
89 bool available() const;
91 LyXView * owner() const;
93 void beforeChange(LyXText *);
95 void finishChange(bool fitcur = false);
97 void savePosition(unsigned int i);
99 void restorePosition(unsigned int i);
101 bool isSavedPosition(unsigned int i);
102 /** This holds the mapping between buffer paragraphs and screen rows.
103 This should be private...but not yet. (Lgb)
107 LyXText * getLyXText() const;
109 LyXText * getParentText(Inset * inset) const;
111 Language const * getParentLanguage(Inset * inset) const;
113 int workWidth() const;
115 UpdatableInset * theLockingInset() const;
117 void theLockingInset(UpdatableInset * inset);
119 void updateInset(Inset * inset, bool mark_dirty);
127 void replaceWord(string const & replacestring);
129 void endOfSpellCheck();
131 void selectLastWord();
132 /// return the next word
133 WordLangTuple const nextWord(float & value);
135 bool gotoLabel(string const & label);
137 void message(string const & msg) const;
141 void cut(bool realcut = true);
145 void pasteEnvironment();
147 void copyEnvironment();
152 /// removes all autodeletable insets
153 bool removeAutoInsets();
155 void insertErrors(TeXErrors & terr);
157 void setCursorFromRow(int row);
158 /** Insert an inset into the buffer.
159 Placie it in a layout of lout,
160 if no_table make sure that it doesn't end up in a table.
162 //bool insertInset(Inset * inset, string const & lout = string(),
163 // bool no_table = false);
164 bool insertInset(Inset * inset, string const & lout = string());
165 /** Inserts a lyx file at cursor position.
166 \return #false# if it fails.
168 bool insertLyXFile(string const & file);
170 bool lockInset(UpdatableInset * inset);
172 void showLockedInsetCursor(int x, int y, int asc, int desc);
174 void hideLockedInsetCursor();
176 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
178 int unlockInset(UpdatableInset * inset);
180 void lockedInsetStoreUndo(Undo::undo_kind kind);
186 void toggleSelection(bool = true);
192 /// Scroll the view by a number of pixels
193 void scrollDocView(int);
199 bool ChangeInsets(Inset::Code code, string const & from,
202 bool ChangeRefsIfUnique(string const & from, string const & to);
204 bool ChangeCitationsIfUnique(string const & from, string const & to);
206 string const getClipboard() const;
208 void pasteClipboard(bool asPara);
210 void stuffClipboard(string const &) const;
212 bool dispatch(FuncRequest const & argument);
214 void moveCursorUpdate(bool selecting, bool fitcur = true);
219 friend struct BufferView::Pimpl;
226 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
227 BufferView::UpdateCodes uc2);