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
21 #include <boost/utility.hpp>
31 class BufferView : public noncopyable {
46 BufferView(LyXView * owner, int , int , int, int);
50 Buffer * buffer() const;
54 LyXScreen * screen() const;
56 WorkArea * workarea() const;
58 void buffer(Buffer * b);
60 void resize(int, int, int, int);
66 void fitCursor(LyXText *);
70 void update(UpdateCodes uc);
72 void updateScrollbar();
74 Inset * checkInsetHit(LyXText *, int & x, int & y,
77 void redoCurrentBuffer();
79 int resizeCurrentBuffer();
83 void cursorPrevious(LyXText *);
85 void cursorNext(LyXText *);
87 bool available() const;
89 LyXView * owner() const;
95 void restorePosition();
97 bool NoSavedPositions();
98 /** This holds the mapping between buffer paragraphs and screen rows.
99 This should be private...but not yet. (Lgb)
103 int workWidth() const;
105 UpdatableInset * theLockingInset() const;
107 void theLockingInset(UpdatableInset * inset);
109 void updateInset(Inset * inset, bool mark_dirty);
123 void replaceWord(string const & replacestring);
125 void endOfSpellCheck();
127 void selectLastWord();
129 string const nextWord(float & value);
131 void insertCorrectQuote();
135 bool gotoLabel(string const & label);
143 void pasteEnvironment();
145 void copyEnvironment();
149 void protectedBlank();
153 void menuSeparator();
155 void endOfSentenceDot();
159 void hyphenationPoint();
174 void allFloats(char flag, char figmar);
176 /// removes all autodeletable insets
177 bool removeAutoInsets();
179 void insertErrors(TeXErrors & terr);
181 void setCursorFromRow(int row);
182 /** Insert an inset into the buffer.
183 Placie it in a layout of lout,
184 if no_table make sure that it doesn't end up in a table.
186 bool insertInset(Inset * inset, string const & lout = string(),
187 bool no_table = false);
188 /// open and lock an updatable inset
189 bool open_new_inset(UpdatableInset * new_inset);
190 /** Inserts a lyx file at cursor position.
191 @return #false# if it fails.
193 bool insertLyXFile(string const & file);
195 bool lockInset(UpdatableInset * inset);
197 void showLockedInsetCursor(int x, int y, int asc, int desc);
199 void hideLockedInsetCursor();
201 void fitLockedInsetCursor(int x, int y, int asc, int desc);
203 int unlockInset(UpdatableInset * inset);
205 void lockedInsetStoreUndo(Undo::undo_kind kind);
211 void toggleSelection(bool = true);
224 bool belowMouse() const;
225 /// A callback for the slider in the scrollbar.
226 void scrollCB(double);
232 void pushIntoUpdateList(Inset * i);
234 void workAreaExpose();
236 void workAreaButtonPress(int x, int y, unsigned int button);
238 void workAreaButtonRelease(int x, int y, unsigned int button);
240 void workAreaMotionNotify(int x, int y, unsigned int state);
242 void doubleClick(int x, int y, unsigned int button);
244 void tripleClick(int x, int y, unsigned int button);
250 bool ChangeRefs(string const & from, string const & to);
252 bool ChangeRefsIfUnique(string const & from, string const & to);
254 void pasteClipboard(bool asPara);
256 void stuffClipboard(string const &) const;
260 friend struct BufferView::Pimpl;
267 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
268 BufferView::UpdateCodes uc2);