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 "support/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);
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 * the_locking_inset;
107 void updateInset(Inset * inset, bool mark_dirty);
121 void replaceWord(string const & replacestring);
123 void endOfSpellCheck();
125 void selectLastWord();
127 char * nextWord(float & value);
129 void insertCorrectQuote();
133 bool gotoLabel(string const & label);
141 void pasteEnvironment();
143 void copyEnvironment();
147 void protectedBlank();
151 void menuSeparator();
153 void endOfSentenceDot();
157 void hyphenationPoint();
172 void allFloats(char flag, char figmar);
174 /// removes all autodeletable insets
175 bool removeAutoInsets();
177 void insertErrors(TeXErrors & terr);
179 void setCursorFromRow(int row);
180 /** Insert an inset into the buffer.
181 Placie it in a layout of lout,
182 if no_table make sure that it doesn't end up in a table.
184 bool insertInset(Inset * inset, string const & lout = string(),
185 bool no_table = false);
186 /// open and lock an updatable inset
187 bool open_new_inset(UpdatableInset * new_inset);
188 /** Inserts a lyx file at cursor position.
189 @return #false# if it fails.
191 bool insertLyXFile(string const & file);
193 bool lockInset(UpdatableInset * inset);
195 void showLockedInsetCursor(long x, long y, int asc, int desc);
197 void hideLockedInsetCursor();
199 void fitLockedInsetCursor(long x, long y, int asc, int desc);
201 int unlockInset(UpdatableInset * inset);
203 void lockedInsetStoreUndo(Undo::undo_kind kind);
209 void toggleSelection(bool = true);
222 bool belowMouse() const;
223 /// A callback for the slider in the scrollbar.
224 void scrollCB(double);
230 void pushIntoUpdateList(Inset * i);
232 void workAreaExpose();
234 void workAreaButtonPress(int x, int y, unsigned int button);
236 void workAreaButtonRelease(int x, int y, unsigned int button);
238 void workAreaMotionNotify(int x, int y, unsigned int state);
240 void doubleClick(int x, int y, unsigned int button);
242 void tripleClick(int x, int y, unsigned int button);
248 bool ChangeRefs(string const & from, string const & to);
250 void pasteClipboard(bool asPara);
252 void stuffClipboard(string const &) const;
256 friend struct BufferView::Pimpl;
263 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
264 BufferView::UpdateCodes uc2);