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 Inset * checkInsetHit(LyXText *, int & x, int & y);
83 void redoCurrentBuffer();
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);
121 void replaceWord(string const & replacestring);
123 void endOfSpellCheck();
125 void selectLastWord();
126 /// return the next word
127 WordLangTuple const nextWord(float & value);
129 bool gotoLabel(string const & label);
131 void pasteEnvironment();
133 void copyEnvironment();
138 /// removes all autodeletable insets
139 bool removeAutoInsets();
141 void insertErrors(TeXErrors & terr);
143 void setCursorFromRow(int row);
144 /** Insert an inset into the buffer.
145 Place it in a layout of lout,
146 if no_table make sure that it doesn't end up in a table.
148 bool insertInset(Inset * inset, string const & lout = string());
149 /// Inserts a lyx file at cursor position. return #false# if it fails
150 bool insertLyXFile(string const & file);
152 bool lockInset(UpdatableInset * inset);
154 void showLockedInsetCursor(int x, int y, int asc, int desc);
156 void hideLockedInsetCursor();
158 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
160 int unlockInset(UpdatableInset * inset);
162 void lockedInsetStoreUndo(Undo::undo_kind kind);
168 void toggleSelection(bool = true);
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);