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>
35 class BufferView : boost::noncopyable {
50 BufferView(LyXView * owner, int , int , int, int);
54 Buffer * buffer() const;
56 Painter & painter() const;
58 LyXScreen & screen() const;
60 void buffer(Buffer * b);
64 * Repaint the pixmap. Used for when we don't want
65 * to go through the full update() logic, just a simple
66 * repaint of the whole screen.
74 void update(LyXText *, UpdateCodes uc);
76 void updateScrollbar();
78 void redoCurrentBuffer();
80 bool available() const;
82 LyXView * owner() const;
84 void beforeChange(LyXText *);
86 void savePosition(unsigned int i);
88 void restorePosition(unsigned int i);
90 bool isSavedPosition(unsigned int i);
91 /** This holds the mapping between buffer paragraphs and screen rows.
92 This should be private...but not yet. (Lgb)
96 LyXText * getLyXText() const;
98 LyXText * getParentText(Inset * inset) const;
100 Language const * getParentLanguage(Inset * inset) const;
102 int workWidth() const;
104 UpdatableInset * theLockingInset() const;
106 void theLockingInset(UpdatableInset * inset);
108 void updateInset(Inset * inset, bool mark_dirty);
116 void replaceWord(string const & replacestring);
118 void endOfSpellCheck();
120 void selectLastWord();
121 /// return the next word
122 WordLangTuple const nextWord(float & value);
124 bool gotoLabel(string const & label);
126 void pasteEnvironment();
128 void copyEnvironment();
133 /// removes all autodeletable insets
134 bool removeAutoInsets();
136 void insertErrors(TeXErrors & terr);
138 void setCursorFromRow(int row);
139 /** Insert an inset into the buffer.
140 Place it in a layout of lout,
141 if no_table make sure that it doesn't end up in a table.
143 bool insertInset(Inset * inset, string const & lout = string());
144 /// Inserts a lyx file at cursor position. return #false# if it fails
145 bool insertLyXFile(string const & file);
147 bool lockInset(UpdatableInset * inset);
149 void showLockedInsetCursor(int x, int y, int asc, int desc);
151 void hideLockedInsetCursor();
153 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
155 int unlockInset(UpdatableInset * inset);
157 void lockedInsetStoreUndo(Undo::undo_kind kind);
163 void toggleSelection(bool = true);
169 int scroll(long time);
171 /// Scroll the view by a number of pixels
172 void scrollDocView(int);
178 bool ChangeInsets(Inset::Code code, string const & from,
181 bool ChangeRefsIfUnique(string const & from, string const & to);
183 bool ChangeCitationsIfUnique(string const & from, string const & to);
185 string const getClipboard() const;
187 void stuffClipboard(string const &) const;
189 bool dispatch(FuncRequest const & argument);
190 /// height of a normal line in pixels (zoom factor considered)
191 int defaultHeight() const;
193 void haveSelection(bool sel);
195 int workHeight() const;
201 friend struct BufferView::Pimpl;
208 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
209 BufferView::UpdateCodes uc2);