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 LyXScreen * 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);
125 void replaceWord(string const & replacestring);
127 void endOfSpellCheck();
129 void selectLastWord();
131 string const nextWord(float & value);
133 bool gotoLabel(string const & label);
137 void cut(bool realcut = true);
141 void pasteEnvironment();
143 void copyEnvironment();
148 /// removes all autodeletable insets
149 bool removeAutoInsets();
151 void insertErrors(TeXErrors & terr);
153 void setCursorFromRow(int row);
154 /** Insert an inset into the buffer.
155 Placie it in a layout of lout,
156 if no_table make sure that it doesn't end up in a table.
158 //bool insertInset(Inset * inset, string const & lout = string(),
159 // bool no_table = false);
160 bool insertInset(Inset * inset, string const & lout = string());
161 /** Inserts a lyx file at cursor position.
162 \return #false# if it fails.
164 bool insertLyXFile(string const & file);
166 bool lockInset(UpdatableInset * inset);
168 void showLockedInsetCursor(int x, int y, int asc, int desc);
170 void hideLockedInsetCursor();
172 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
174 int unlockInset(UpdatableInset * inset);
176 void lockedInsetStoreUndo(Undo::undo_kind kind);
182 void toggleSelection(bool = true);
195 bool belowMouse() const;
196 /// A callback for the slider in the scrollbar.
197 void scrollCB(double);
203 bool ChangeInsets(Inset::Code code, string const & from,
206 bool ChangeRefsIfUnique(string const & from, string const & to);
208 bool ChangeCitationsIfUnique(string const & from, string const & to);
210 string const getClipboard() const;
212 void pasteClipboard(bool asPara);
214 void stuffClipboard(string const &) const;
216 bool Dispatch(kb_action action, string const & argument);
221 friend struct BufferView::Pimpl;
228 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
229 BufferView::UpdateCodes uc2);