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(LyXText *, UpdateCodes uc);
73 void updateScrollbar();
75 Inset * checkInsetHit(LyXText *, int & x, int & y,
78 void redoCurrentBuffer();
80 int resizeCurrentBuffer();
82 void gotoInset(std::vector<Inset::Code> const & codes,
85 void gotoInset(Inset::Code codes, bool same_content);
87 void cursorPrevious(LyXText *);
89 void cursorNext(LyXText *);
91 bool available() const;
93 LyXView * owner() const;
95 void beforeChange(LyXText *);
97 void savePosition(unsigned int i);
99 void restorePosition(unsigned int i);
101 bool isSavedPosition(unsigned int i);
102 /** This holds the mapping between buffer paragraphs and screen rows.
103 This should be private...but not yet. (Lgb)
107 LyXText * getLyXText() const;
109 LyXText * getParentText(Inset * inset) const;
111 Language const * getParentLanguage(Inset * inset) const;
113 int workWidth() const;
115 UpdatableInset * theLockingInset() const;
117 void theLockingInset(UpdatableInset * inset);
119 void updateInset(Inset * inset, bool mark_dirty);
133 void replaceWord(string const & replacestring);
135 void endOfSpellCheck();
137 void selectLastWord();
139 string const nextWord(float & value);
141 void insertCorrectQuote();
143 bool gotoLabel(string const & label);
151 void pasteEnvironment();
153 void copyEnvironment();
157 void protectedBlank(LyXText *);
161 void menuSeparator();
163 void endOfSentenceDot();
167 void hyphenationPoint();
182 void allFloats(char flag, char figmar);
184 /// removes all autodeletable insets
185 bool removeAutoInsets();
187 void insertErrors(TeXErrors & terr);
189 void setCursorFromRow(int row);
190 /** Insert an inset into the buffer.
191 Placie it in a layout of lout,
192 if no_table make sure that it doesn't end up in a table.
194 bool insertInset(Inset * inset, string const & lout = string(),
195 bool no_table = false);
196 /// open and lock an updatable inset
197 bool open_new_inset(UpdatableInset * new_inset, bool behind = false);
198 /** Inserts a lyx file at cursor position.
199 @return #false# if it fails.
201 bool insertLyXFile(string const & file);
203 bool lockInset(UpdatableInset * inset);
205 void showLockedInsetCursor(int x, int y, int asc, int desc);
207 void hideLockedInsetCursor();
209 void fitLockedInsetCursor(int x, int y, int asc, int desc);
211 int unlockInset(UpdatableInset * inset);
213 void lockedInsetStoreUndo(Undo::undo_kind kind);
219 void toggleSelection(bool = true);
232 bool belowMouse() const;
233 /// A callback for the slider in the scrollbar.
234 void scrollCB(double);
240 void pushIntoUpdateList(Inset * i);
243 void workAreaExpose();
245 void workAreaButtonPress(int x, int y, unsigned int button);
247 void workAreaButtonRelease(int x, int y, unsigned int button);
249 void workAreaMotionNotify(int x, int y, unsigned int state);
251 void doubleClick(int x, int y, unsigned int button);
253 void tripleClick(int x, int y, unsigned int button);
260 bool ChangeInsets(Inset::Code code, string const & from,
263 bool ChangeRefsIfUnique(string const & from, string const & to);
265 bool ChangeCitationsIfUnique(string const & from, string const & to);
267 void pasteClipboard(bool asPara);
269 void stuffClipboard(string const &) const;
273 friend struct BufferView::Pimpl;
280 BufferView::UpdateCodes operator|(BufferView::UpdateCodes uc1,
281 BufferView::UpdateCodes uc2);