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 LyXText * getLyXText() const;
105 int workWidth() const;
107 UpdatableInset * theLockingInset() const;
109 void theLockingInset(UpdatableInset * inset);
111 void updateInset(Inset * inset, bool mark_dirty);
125 void replaceWord(string const & replacestring);
127 void endOfSpellCheck();
129 void selectLastWord();
131 string const nextWord(float & value);
133 void insertCorrectQuote();
137 bool gotoLabel(string const & label);
145 void pasteEnvironment();
147 void copyEnvironment();
151 void protectedBlank();
155 void menuSeparator();
157 void endOfSentenceDot();
161 void hyphenationPoint();
176 void allFloats(char flag, char figmar);
178 /// removes all autodeletable insets
179 bool removeAutoInsets();
181 void insertErrors(TeXErrors & terr);
183 void setCursorFromRow(int row);
184 /** Insert an inset into the buffer.
185 Placie it in a layout of lout,
186 if no_table make sure that it doesn't end up in a table.
188 bool insertInset(Inset * inset, string const & lout = string(),
189 bool no_table = false);
190 /// open and lock an updatable inset
191 bool open_new_inset(UpdatableInset * new_inset);
192 /** Inserts a lyx file at cursor position.
193 @return #false# if it fails.
195 bool insertLyXFile(string const & file);
197 bool lockInset(UpdatableInset * inset);
199 void showLockedInsetCursor(int x, int y, int asc, int desc);
201 void hideLockedInsetCursor();
203 void fitLockedInsetCursor(int x, int y, int asc, int desc);
205 int unlockInset(UpdatableInset * inset);
207 void lockedInsetStoreUndo(Undo::undo_kind kind);
213 void toggleSelection(bool = true);
226 bool belowMouse() const;
227 /// A callback for the slider in the scrollbar.
228 void scrollCB(double);
234 void pushIntoUpdateList(Inset * i);
236 void workAreaExpose();
238 void workAreaButtonPress(int x, int y, unsigned int button);
240 void workAreaButtonRelease(int x, int y, unsigned int button);
242 void workAreaMotionNotify(int x, int y, unsigned int state);
244 void doubleClick(int x, int y, unsigned int button);
246 void tripleClick(int x, int y, unsigned int button);
252 bool ChangeRefs(string const & from, string const & to);
254 bool ChangeRefsIfUnique(string const & from, string const & to);
256 void pasteClipboard(bool asPara);
258 void stuffClipboard(string const &) const;
262 friend struct BufferView::Pimpl;
269 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
270 BufferView::UpdateCodes uc2);