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 bool available() const;
87 LyXView * owner() const;
89 void beforeChange(LyXText *);
91 void finishChange(bool fitcur = false);
93 void savePosition(unsigned int i);
95 void restorePosition(unsigned int i);
97 bool isSavedPosition(unsigned int i);
98 /** This holds the mapping between buffer paragraphs and screen rows.
99 This should be private...but not yet. (Lgb)
103 LyXText * getLyXText() const;
105 LyXText * getParentText(Inset * inset) const;
107 Language const * getParentLanguage(Inset * inset) const;
109 int workWidth() const;
111 UpdatableInset * theLockingInset() const;
113 void theLockingInset(UpdatableInset * inset);
115 void updateInset(Inset * inset, bool mark_dirty);
123 void replaceWord(string const & replacestring);
125 void endOfSpellCheck();
127 void selectLastWord();
128 /// return the next word
129 WordLangTuple const nextWord(float & value);
131 bool gotoLabel(string const & label);
133 void pasteEnvironment();
135 void copyEnvironment();
140 /// removes all autodeletable insets
141 bool removeAutoInsets();
143 void insertErrors(TeXErrors & terr);
145 void setCursorFromRow(int row);
146 /** Insert an inset into the buffer.
147 Place it in a layout of lout,
148 if no_table make sure that it doesn't end up in a table.
150 bool insertInset(Inset * inset, string const & lout = string());
151 /// Inserts a lyx file at cursor position. return #false# if it fails
152 bool insertLyXFile(string const & file);
154 bool lockInset(UpdatableInset * inset);
156 void showLockedInsetCursor(int x, int y, int asc, int desc);
158 void hideLockedInsetCursor();
160 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
162 int unlockInset(UpdatableInset * inset);
164 void lockedInsetStoreUndo(Undo::undo_kind kind);
170 void toggleSelection(bool = true);
176 /// Scroll the view by a number of pixels
177 void scrollDocView(int);
183 bool ChangeInsets(Inset::Code code, string const & from,
186 bool ChangeRefsIfUnique(string const & from, string const & to);
188 bool ChangeCitationsIfUnique(string const & from, string const & to);
190 string const getClipboard() const;
192 void stuffClipboard(string const &) const;
194 bool dispatch(FuncRequest const & argument);
196 void moveCursorUpdate(bool selecting, bool fitcur = true);
201 friend struct BufferView::Pimpl;
208 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
209 BufferView::UpdateCodes uc2);