2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2000 The LyX Team.
10 * ====================================================== */
19 #include FORMS_H_LOCATION
22 #include "commandtags.h"
23 #include <boost/utility.hpp>
34 class BufferView : public boost::noncopyable {
49 BufferView(LyXView * owner, int , int , int, int);
53 Buffer * buffer() const;
57 LyXScreen * screen() const;
59 WorkArea * workarea() const;
61 void buffer(Buffer * b);
63 void resize(int, int, int, int);
69 void fitCursor(LyXText *);
73 void update(LyXText *, UpdateCodes uc);
75 void updateScrollbar();
77 Inset * checkInsetHit(LyXText *, int & x, int & y,
80 void redoCurrentBuffer();
82 int resizeCurrentBuffer();
84 void gotoInset(std::vector<Inset::Code> const & codes,
87 void gotoInset(Inset::Code codes, bool same_content);
89 void cursorPrevious(LyXText *);
91 void cursorNext(LyXText *);
93 bool available() const;
95 LyXView * owner() const;
97 void beforeChange(LyXText *);
99 void savePosition(unsigned int i);
101 void restorePosition(unsigned int i);
103 bool isSavedPosition(unsigned int i);
104 /** This holds the mapping between buffer paragraphs and screen rows.
105 This should be private...but not yet. (Lgb)
109 LyXText * getLyXText() const;
111 LyXText * getParentText(Inset * inset) const;
113 Language const * getParentLanguage(Inset * inset) const;
115 int workWidth() const;
117 UpdatableInset * theLockingInset() const;
119 void theLockingInset(UpdatableInset * inset);
121 void updateInset(Inset * inset, bool mark_dirty);
135 void replaceWord(string const & replacestring);
137 void endOfSpellCheck();
139 void selectLastWord();
141 string const nextWord(float & value);
143 void insertCorrectQuote();
145 bool gotoLabel(string const & label);
153 void pasteEnvironment();
155 void copyEnvironment();
159 void protectedBlank(LyXText *);
163 void menuSeparator();
165 void endOfSentenceDot();
169 void hyphenationPoint();
184 void allFloats(char flag, char figmar);
186 /// removes all autodeletable insets
187 bool removeAutoInsets();
189 void insertErrors(TeXErrors & terr);
191 void setCursorFromRow(int row);
192 /** Insert an inset into the buffer.
193 Placie it in a layout of lout,
194 if no_table make sure that it doesn't end up in a table.
196 bool insertInset(Inset * inset, string const & lout = string(),
197 bool no_table = false);
198 /// open and lock an updatable inset
199 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
200 /** Inserts a lyx file at cursor position.
201 @return #false# if it fails.
203 bool insertLyXFile(string const & file);
205 bool lockInset(UpdatableInset * inset);
207 void showLockedInsetCursor(int x, int y, int asc, int desc);
209 void hideLockedInsetCursor();
211 void fitLockedInsetCursor(int x, int y, int asc, int desc);
213 int unlockInset(UpdatableInset * inset);
215 void lockedInsetStoreUndo(Undo::undo_kind kind);
221 void toggleSelection(bool = true);
234 bool belowMouse() const;
235 /// A callback for the slider in the scrollbar.
236 void scrollCB(double);
242 void pushIntoUpdateList(Inset * i);
244 bool ChangeInsets(Inset::Code code, string const & from,
247 bool ChangeRefsIfUnique(string const & from, string const & to);
249 bool ChangeCitationsIfUnique(string const & from, string const & to);
251 void pasteClipboard(bool asPara);
253 void stuffClipboard(string const &) const;
255 bool Dispatch(kb_action action, string const & argument);
259 friend struct BufferView::Pimpl;
266 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
267 BufferView::UpdateCodes uc2);