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;
55 Painter & painter() const;
57 LyXScreen & screen() const;
59 void buffer(Buffer * b);
69 void update(LyXText *, UpdateCodes uc);
71 void updateScrollbar();
73 Inset * checkInsetHit(LyXText *, int & x, int & y);
75 void redoCurrentBuffer();
77 void cursorPrevious(LyXText *);
79 void cursorNext(LyXText *);
81 bool available() const;
83 LyXView * owner() const;
85 void beforeChange(LyXText *);
87 void savePosition(unsigned int i);
89 void restorePosition(unsigned int i);
91 bool isSavedPosition(unsigned int i);
92 /** This holds the mapping between buffer paragraphs and screen rows.
93 This should be private...but not yet. (Lgb)
97 LyXText * getLyXText() const;
99 LyXText * getParentText(Inset * inset) const;
101 Language const * getParentLanguage(Inset * inset) const;
103 int workWidth() const;
105 UpdatableInset * theLockingInset() const;
107 void theLockingInset(UpdatableInset * inset);
109 void updateInset(Inset * inset, bool mark_dirty);
117 void replaceWord(string const & replacestring);
119 void endOfSpellCheck();
121 void selectLastWord();
123 string const nextWord(float & value);
125 bool gotoLabel(string const & label);
129 void cut(bool realcut = true);
133 void pasteEnvironment();
135 void copyEnvironment();
140 /// removes all autodeletable insets
141 bool removeAutoInsets();
143 void insertErrors(TeXErrors & terr);
145 void setCursorFromRow(int row);
146 /** Insert an inset into the buffer.
147 Placie it in a layout of lout,
148 if no_table make sure that it doesn't end up in a table.
150 //bool insertInset(Inset * inset, string const & lout = string(),
151 // bool no_table = false);
152 bool insertInset(Inset * inset, string const & lout = string());
153 /** Inserts a lyx file at cursor position.
154 \return #false# if it fails.
156 bool insertLyXFile(string const & file);
158 bool lockInset(UpdatableInset * inset);
160 void showLockedInsetCursor(int x, int y, int asc, int desc);
162 void hideLockedInsetCursor();
164 bool fitLockedInsetCursor(int x, int y, int asc, int desc);
166 int unlockInset(UpdatableInset * inset);
168 void lockedInsetStoreUndo(Undo::undo_kind kind);
174 void toggleSelection(bool = true);
180 /// Scroll the view by a number of pixels
181 void scrollDocView(int);
187 bool ChangeInsets(Inset::Code code, string const & from,
190 bool ChangeRefsIfUnique(string const & from, string const & to);
192 bool ChangeCitationsIfUnique(string const & from, string const & to);
194 string const getClipboard() const;
196 void pasteClipboard(bool asPara);
198 void stuffClipboard(string const &) const;
200 bool Dispatch(kb_action action, string const & argument);
205 friend struct BufferView::Pimpl;
212 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
213 BufferView::UpdateCodes uc2);