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 {
42 BufferView(LyXView * owner, int , int , int, int);
46 Buffer * buffer() const;
50 LyXScreen * screen() const;
52 WorkArea * workarea() const;
54 void buffer(Buffer * b);
56 void resize(int, int, int, int);
66 void update(UpdateCodes uc);
68 void updateScrollbar();
70 Inset * checkInsetHit(LyXText *, int & x, int & y, unsigned int button);
72 void redoCurrentBuffer();
74 int resizeCurrentBuffer();
78 void cursorPrevious();
82 bool available() const;
84 LyXView * owner() const;
90 void restorePosition();
92 bool NoSavedPositions();
93 /** This holds the mapping between buffer paragraphs and screen rows.
94 This should be private...but not yet. (Lgb)
98 int workWidth() const;
100 UpdatableInset * the_locking_inset;
102 void updateInset(Inset * inset, bool mark_dirty);
116 void replaceWord(string const & replacestring);
118 void endOfSpellCheck();
120 void selectLastWord();
122 char * nextWord(float & value);
124 void insertCorrectQuote();
128 bool gotoLabel(string const & label);
136 void pasteEnvironment();
138 void copyEnvironment();
142 void protectedBlank();
146 void menuSeparator();
148 void endOfSentenceDot();
152 void hyphenationPoint();
167 void allFloats(char flag, char figmar);
169 /// removes all autodeletable insets
170 bool removeAutoInsets();
172 void insertErrors(TeXErrors & terr);
174 void setCursorFromRow(int row);
175 /** Insert an inset into the buffer
176 Insert inset into buffer, placing it in a layout of lout,
177 if no_table make sure that it doesn't end up in a table. */
178 bool insertInset(Inset * inset, string const & lout = string(),
179 bool no_table = false);
180 /// open and lock an updatable inset
181 bool open_new_inset(UpdatableInset * new_inset);
182 /// Inserts a lyx file at cursor position. Returns false if it fails.
183 bool insertLyXFile(string const & file);
185 bool lockInset(UpdatableInset * inset);
187 void showLockedInsetCursor(long x, long y, int asc, int desc);
189 void hideLockedInsetCursor();
191 void fitLockedInsetCursor(long x, long y, int asc, int desc);
193 int unlockInset(UpdatableInset * inset);
195 void lockedInsetStoreUndo(Undo::undo_kind kind);
201 void toggleSelection(bool = true);
214 bool belowMouse() const;
215 /// A callback for the slider in the scrollbar.
216 void scrollCB(double);
222 void pushIntoUpdateList(Inset * i);
224 void workAreaExpose();
226 void workAreaButtonPress(int x, int y, unsigned int button);
228 void workAreaButtonRelease(int x, int y, unsigned int button);
230 void workAreaMotionNotify(int x, int y, unsigned int state);
232 void doubleClick(int x, int y, unsigned int button);
234 void tripleClick(int x, int y, unsigned int button);
240 bool ChangeRefs(string const & from, string const & to);
242 void pasteClipboard(bool asPara);
244 void stuffClipboard(string const &) const;
247 friend struct BufferView::Pimpl;
252 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
253 BufferView::UpdateCodes uc2);