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>
32 class BufferView : public noncopyable {
47 BufferView(LyXView * owner, int , int , int, int);
51 Buffer * buffer() const;
55 LyXScreen * screen() const;
57 WorkArea * workarea() const;
59 void buffer(Buffer * b);
61 void resize(int, int, int, int);
67 void fitCursor(LyXText *);
71 void update(UpdateCodes uc);
73 void updateScrollbar();
75 Inset * checkInsetHit(LyXText *, int & x, int & y,
78 void redoCurrentBuffer();
80 int resizeCurrentBuffer();
84 void cursorPrevious(LyXText *);
86 void cursorNext(LyXText *);
88 bool available() const;
90 LyXView * owner() const;
96 void restorePosition();
98 bool NoSavedPositions();
99 /** This holds the mapping between buffer paragraphs and screen rows.
100 This should be private...but not yet. (Lgb)
104 LyXText * getLyXText() const;
106 LyXText * getParentText(Inset * inset) const;
108 Language const * getParentLanguage(Inset * inset) const;
110 int workWidth() const;
112 UpdatableInset * theLockingInset() const;
114 void theLockingInset(UpdatableInset * inset);
116 void updateInset(Inset * inset, bool mark_dirty);
130 void replaceWord(string const & replacestring);
132 void endOfSpellCheck();
134 void selectLastWord();
136 string const nextWord(float & value);
138 void insertCorrectQuote();
142 bool gotoLabel(string const & label);
150 void pasteEnvironment();
152 void copyEnvironment();
156 void protectedBlank();
160 void menuSeparator();
162 void endOfSentenceDot();
166 void hyphenationPoint();
181 void allFloats(char flag, char figmar);
183 /// removes all autodeletable insets
184 bool removeAutoInsets();
186 void insertErrors(TeXErrors & terr);
188 void setCursorFromRow(int row);
189 /** Insert an inset into the buffer.
190 Placie it in a layout of lout,
191 if no_table make sure that it doesn't end up in a table.
193 bool insertInset(Inset * inset, string const & lout = string(),
194 bool no_table = false);
195 /// open and lock an updatable inset
196 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
197 /** Inserts a lyx file at cursor position.
198 @return #false# if it fails.
200 bool insertLyXFile(string const & file);
202 bool lockInset(UpdatableInset * inset);
204 void showLockedInsetCursor(int x, int y, int asc, int desc);
206 void hideLockedInsetCursor();
208 void fitLockedInsetCursor(int x, int y, int asc, int desc);
210 int unlockInset(UpdatableInset * inset);
212 void lockedInsetStoreUndo(Undo::undo_kind kind);
218 void toggleSelection(bool = true);
231 bool belowMouse() const;
232 /// A callback for the slider in the scrollbar.
233 void scrollCB(double);
239 void pushIntoUpdateList(Inset * i);
242 void workAreaExpose();
244 void workAreaButtonPress(int x, int y, unsigned int button);
246 void workAreaButtonRelease(int x, int y, unsigned int button);
248 void workAreaMotionNotify(int x, int y, unsigned int state);
250 void doubleClick(int x, int y, unsigned int button);
252 void tripleClick(int x, int y, unsigned int button);
259 bool ChangeRefs(string const & from, string const & to);
261 bool ChangeRefsIfUnique(string const & from, string const & to);
263 void pasteClipboard(bool asPara);
265 void stuffClipboard(string const &) const;
269 friend struct BufferView::Pimpl;
276 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
277 BufferView::UpdateCodes uc2);