3 * Copyright 2002 the LyX Team
4 * Read the file COPYING
6 * \author Lars Gullik Bjønnes
18 #include "commandtags.h"
20 #include "insets/inset.h"
22 #include <boost/utility.hpp>
34 class BufferView : boost::noncopyable {
49 BufferView(LyXView * owner, int , int , int, int);
53 Buffer * buffer() const;
57 LScreen & screen() const;
59 void buffer(Buffer * b);
61 void resize(int, int, int, int);
71 void update(LyXText *, UpdateCodes uc);
73 void updateScrollbar();
75 Inset * checkInsetHit(LyXText *, int & x, int & y);
77 void redoCurrentBuffer();
79 int resizeCurrentBuffer();
81 void cursorPrevious(LyXText *);
83 void cursorNext(LyXText *);
85 bool available() const;
87 LyXView * owner() const;
89 void beforeChange(LyXText *);
91 void savePosition(unsigned int i);
93 void restorePosition(unsigned int i);
95 bool isSavedPosition(unsigned int i);
96 /** This holds the mapping between buffer paragraphs and screen rows.
97 This should be private...but not yet. (Lgb)
101 LyXText * getLyXText() const;
103 LyXText * getParentText(Inset * inset) const;
105 Language const * getParentLanguage(Inset * inset) const;
107 int workWidth() const;
109 UpdatableInset * theLockingInset() const;
111 void theLockingInset(UpdatableInset * inset);
113 void updateInset(Inset * inset, bool mark_dirty);
127 void replaceWord(string const & replacestring);
129 void endOfSpellCheck();
131 void selectLastWord();
133 string const nextWord(float & value);
135 bool gotoLabel(string const & label);
139 void cut(bool realcut = true);
143 void pasteEnvironment();
145 void copyEnvironment();
150 /// removes all autodeletable insets
151 bool removeAutoInsets();
153 void insertErrors(TeXErrors & terr);
155 void setCursorFromRow(int row);
156 /** Insert an inset into the buffer.
157 Placie it in a layout of lout,
158 if no_table make sure that it doesn't end up in a table.
160 //bool insertInset(Inset * inset, string const & lout = string(),
161 // bool no_table = false);
162 bool insertInset(Inset * inset, string const & lout = string());
163 /** Inserts a lyx file at cursor position.
164 \return #false# if it fails.
166 bool insertLyXFile(string const & file);
168 bool lockInset(UpdatableInset * inset);
170 void showLockedInsetCursor(int x, int y, int asc, int desc);
172 void hideLockedInsetCursor();
174 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
176 int unlockInset(UpdatableInset * inset);
178 void lockedInsetStoreUndo(Undo::undo_kind kind);
184 void toggleSelection(bool = true);
194 /// A callback for the slider in the scrollbar.
195 void scrollCB(double);
201 bool ChangeInsets(Inset::Code code, string const & from,
204 bool ChangeRefsIfUnique(string const & from, string const & to);
206 bool ChangeCitationsIfUnique(string const & from, string const & to);
208 string const getClipboard() const;
210 void pasteClipboard(bool asPara);
212 void stuffClipboard(string const &) const;
214 bool Dispatch(kb_action action, string const & argument);
219 friend struct BufferView::Pimpl;
226 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
227 BufferView::UpdateCodes uc2);