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();
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;
106 void theLockingInset(UpdatableInset const * inset);
108 void updateInset(Inset * inset, bool mark_dirty);
122 void replaceWord(string const & replacestring);
124 void endOfSpellCheck();
126 void selectLastWord();
128 string const nextWord(float & value);
130 void insertCorrectQuote();
134 bool gotoLabel(string const & label);
142 void pasteEnvironment();
144 void copyEnvironment();
148 void protectedBlank();
152 void menuSeparator();
154 void endOfSentenceDot();
158 void hyphenationPoint();
173 void allFloats(char flag, char figmar);
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);
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 void workAreaExpose();
235 void workAreaButtonPress(int x, int y, unsigned int button);
237 void workAreaButtonRelease(int x, int y, unsigned int button);
239 void workAreaMotionNotify(int x, int y, unsigned int state);
241 void doubleClick(int x, int y, unsigned int button);
243 void tripleClick(int x, int y, unsigned int button);
249 bool ChangeRefs(string const & from, string const & to);
251 void pasteClipboard(bool asPara);
253 void stuffClipboard(string const &) const;
257 friend struct BufferView::Pimpl;
264 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
265 BufferView::UpdateCodes uc2);