4 * Copyright 2002 the LyX Team
5 * Read the file COPYING
7 * \author Lars Gullik Bjønnes
20 #include "insets/inset.h"
21 #include "WordLangTuple.h"
23 #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 Inset * checkInsetHit(LyXText *, int & x, int & y);
80 void redoCurrentBuffer();
82 void cursorPrevious(LyXText *);
84 void cursorNext(LyXText *);
86 bool available() const;
88 LyXView * owner() const;
90 void beforeChange(LyXText *);
92 void savePosition(unsigned int i);
94 void restorePosition(unsigned int i);
96 bool isSavedPosition(unsigned int i);
97 /** This holds the mapping between buffer paragraphs and screen rows.
98 This should be private...but not yet. (Lgb)
102 LyXText * getLyXText() const;
104 LyXText * getParentText(Inset * inset) const;
106 Language const * getParentLanguage(Inset * inset) const;
108 int workWidth() const;
110 UpdatableInset * theLockingInset() const;
112 void theLockingInset(UpdatableInset * inset);
114 void updateInset(Inset * inset, bool mark_dirty);
122 void replaceWord(string const & replacestring);
124 void endOfSpellCheck();
126 void selectLastWord();
127 /// return the next word
128 WordLangTuple const nextWord(float & value);
130 bool gotoLabel(string const & label);
134 void cut(bool realcut = true);
138 void pasteEnvironment();
140 void copyEnvironment();
145 /// removes all autodeletable insets
146 bool removeAutoInsets();
148 void insertErrors(TeXErrors & terr);
150 void setCursorFromRow(int row);
151 /** Insert an inset into the buffer.
152 Placie it in a layout of lout,
153 if no_table make sure that it doesn't end up in a table.
155 //bool insertInset(Inset * inset, string const & lout = string(),
156 // bool no_table = false);
157 bool insertInset(Inset * inset, string const & lout = string());
158 /** Inserts a lyx file at cursor position.
159 \return #false# if it fails.
161 bool insertLyXFile(string const & file);
163 bool lockInset(UpdatableInset * inset);
165 void showLockedInsetCursor(int x, int y, int asc, int desc);
167 void hideLockedInsetCursor();
169 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
171 int unlockInset(UpdatableInset * inset);
173 void lockedInsetStoreUndo(Undo::undo_kind kind);
179 void toggleSelection(bool = true);
185 /// Scroll the view by a number of pixels
186 void scrollDocView(int);
192 bool ChangeInsets(Inset::Code code, string const & from,
195 bool ChangeRefsIfUnique(string const & from, string const & to);
197 bool ChangeCitationsIfUnique(string const & from, string const & to);
199 string const getClipboard() const;
201 void pasteClipboard(bool asPara);
203 void stuffClipboard(string const &) const;
205 bool dispatch(FuncRequest const & argument);
210 friend struct BufferView::Pimpl;
217 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
218 BufferView::UpdateCodes uc2);