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 void redoCurrentBuffer();
83 bool available() const;
85 LyXView * owner() const;
87 void beforeChange(LyXText *);
89 void savePosition(unsigned int i);
91 void restorePosition(unsigned int i);
93 bool isSavedPosition(unsigned int i);
94 /** This holds the mapping between buffer paragraphs and screen rows.
95 This should be private...but not yet. (Lgb)
99 LyXText * getLyXText() const;
101 LyXText * getParentText(Inset * inset) const;
103 Language const * getParentLanguage(Inset * inset) const;
105 int workWidth() const;
107 UpdatableInset * theLockingInset() const;
109 void theLockingInset(UpdatableInset * inset);
111 void updateInset(Inset * inset, bool mark_dirty);
119 void replaceWord(string const & replacestring);
121 void endOfSpellCheck();
123 void selectLastWord();
124 /// return the next word
125 WordLangTuple const nextWord(float & value);
127 bool gotoLabel(string const & label);
129 void pasteEnvironment();
131 void copyEnvironment();
136 /// removes all autodeletable insets
137 bool removeAutoInsets();
139 void insertErrors(TeXErrors & terr);
141 void setCursorFromRow(int row);
142 /** Insert an inset into the buffer.
143 Place it in a layout of lout,
144 if no_table make sure that it doesn't end up in a table.
146 bool insertInset(Inset * inset, string const & lout = string());
147 /// Inserts a lyx file at cursor position. return #false# if it fails
148 bool insertLyXFile(string const & file);
150 bool lockInset(UpdatableInset * inset);
152 void showLockedInsetCursor(int x, int y, int asc, int desc);
154 void hideLockedInsetCursor();
156 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
158 int unlockInset(UpdatableInset * inset);
160 void lockedInsetStoreUndo(Undo::undo_kind kind);
166 void toggleSelection(bool = true);
172 int scroll(long time);
174 /// Scroll the view by a number of pixels
175 void scrollDocView(int);
181 bool ChangeInsets(Inset::Code code, string const & from,
184 bool ChangeRefsIfUnique(string const & from, string const & to);
186 bool ChangeCitationsIfUnique(string const & from, string const & to);
188 string const getClipboard() const;
190 void stuffClipboard(string const &) const;
192 bool dispatch(FuncRequest const & argument);
198 friend struct BufferView::Pimpl;
205 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
206 BufferView::UpdateCodes uc2);