class Painter;
class ParIterator;
+
+namespace Update {
+ enum flags {
+ FitCursor = 1,
+ Force = 2,
+ SinglePar = 4,
+ MultiParSel = 8
+ };
+
+inline flags operator|(flags const f, flags const g)
+{
+ return static_cast<flags>(int(f) | int(g));
+}
+
+inline flags operator&(flags const f, flags const g)
+{
+ return static_cast<flags>(int(f) & int(g));
+}
+
+} // namespace
+
+
/**
* A buffer view encapsulates a view onto a particular
* buffer, and allows access to operate upon it. A view
* position changes. \c forceupdate means to force an update
* in any case.
*/
- void update(bool fitcursor = true, bool forceupdate = true);
+
+ void update(Update::flags flags = Update::FitCursor | Update::Force);
/// move the screen to fit the cursor. Only to be called with
/// good y coordinates (after a bv::metrics)
bool fitCursor();
Change const getCurrentChange();
/// return the lyxtext we are using
- LyXText * getLyXText() const;
+ LyXText * getLyXText();
+
+ /// return the lyxtext we are using
+ LyXText const * getLyXText() const;
/// simple replacing. Use the font of the first selected character
void replaceSelectionWithString(std::string const & str);
int offset_ref() const;
/// access to anchor
lyx::pit_type anchor_ref() const;
-
+
/// access to full cursor
LCursor & cursor();
/// access to full cursor
LCursor const & cursor() const;
///
LyXText * text() const;
- ///
- void setCursor(ParIterator const & par, lyx::pos_type pos);
+ /// sets cursor and open all relevant collapsable insets.
+ void setCursor(DocIterator const &);
+ /// sets cursor; this is used when handling LFUN_MOUSE_PRESS.
+ void mouseSetCursor(LCursor & cur);
+
/* Sets the selection. When \c backwards == false, set anchor
* to \c cur and cursor to \c cur + \c length. When \c
* backwards == true, set anchor to \c cur and cursor to \c
*/
void putSelectionAt(DocIterator const & cur,
int length, bool backwards);
-
+ ///
+ bool const repaintAll() const;
+ ///
+ void const repaintAll(bool r) const;
private:
///
- struct Pimpl;
+ class Pimpl;
///
- friend struct BufferView::Pimpl;
+ friend class BufferView::Pimpl;
///
Pimpl * pimpl_;
};