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 * ====================================================== */
21 #include "commandtags.h"
22 #include <boost/utility.hpp>
33 class BufferView : boost::noncopyable {
48 BufferView(LyXView * owner, int , int , int, int);
52 Buffer * buffer() const;
56 LyXScreen * screen() const;
58 WorkArea * workarea() const;
60 void buffer(Buffer * b);
62 void resize(int, int, int, int);
68 void fitCursor(LyXText *);
72 void update(LyXText *, UpdateCodes uc);
74 void updateScrollbar();
76 Inset * checkInsetHit(LyXText *, int & x, int & y,
79 void redoCurrentBuffer();
81 int resizeCurrentBuffer();
83 void gotoInset(std::vector<Inset::Code> const & codes,
86 void gotoInset(Inset::Code codes, bool same_content);
88 void cursorPrevious(LyXText *);
90 void cursorNext(LyXText *);
92 bool available() const;
94 LyXView * owner() const;
96 void beforeChange(LyXText *);
98 void savePosition(unsigned int i);
100 void restorePosition(unsigned int i);
102 bool isSavedPosition(unsigned int i);
103 /** This holds the mapping between buffer paragraphs and screen rows.
104 This should be private...but not yet. (Lgb)
108 LyXText * getLyXText() const;
110 LyXText * getParentText(Inset * inset) const;
112 Language const * getParentLanguage(Inset * inset) const;
114 int workWidth() const;
116 UpdatableInset * theLockingInset() const;
118 void theLockingInset(UpdatableInset * inset);
120 void updateInset(Inset * inset, bool mark_dirty);
134 void replaceWord(string const & replacestring);
136 void endOfSpellCheck();
138 void selectLastWord();
140 string const nextWord(float & value);
142 void insertCorrectQuote();
144 bool gotoLabel(string const & label);
152 void pasteEnvironment();
154 void copyEnvironment();
158 void protectedBlank(LyXText *);
162 void menuSeparator();
164 void endOfSentenceDot();
168 void hyphenationPoint();
175 /// removes all autodeletable insets
176 bool removeAutoInsets();
178 void insertErrors(TeXErrors & terr);
180 void setCursorFromRow(int row);
181 /** Insert an inset into the buffer.
182 Placie it in a layout of lout,
183 if no_table make sure that it doesn't end up in a table.
185 bool insertInset(Inset * inset, string const & lout = string(),
186 bool no_table = false);
187 /// open and lock an updatable inset
188 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
189 /** Inserts a lyx file at cursor position.
190 @return #false# if it fails.
192 bool insertLyXFile(string const & file);
194 bool lockInset(UpdatableInset * inset);
196 void showLockedInsetCursor(int x, int y, int asc, int desc);
198 void hideLockedInsetCursor();
200 void fitLockedInsetCursor(int x, int y, int asc, int desc);
202 int unlockInset(UpdatableInset * inset);
204 void lockedInsetStoreUndo(Undo::undo_kind kind);
210 void toggleSelection(bool = true);
223 bool belowMouse() const;
224 /// A callback for the slider in the scrollbar.
225 void scrollCB(double);
231 void pushIntoUpdateList(Inset * i);
233 bool ChangeInsets(Inset::Code code, string const & from,
236 bool ChangeRefsIfUnique(string const & from, string const & to);
238 bool ChangeCitationsIfUnique(string const & from, string const & to);
240 void pasteClipboard(bool asPara);
242 void stuffClipboard(string const &) const;
244 bool Dispatch(kb_action action, string const & argument);
248 friend struct BufferView::Pimpl;
255 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
256 BufferView::UpdateCodes uc2);