+ /// perform pending metrics updates.
+ /** \c Update::FitCursor means first to do a FitCursor, and to
+ * force an update if screen position changes.
+ * \c Update::Force means to force an update in any case.
+ * \retval true if a screen redraw is needed
+ */
+ void processUpdateFlags(Update::flags flags);
+
+ /// return true if one shall move the screen to fit the cursor.
+ /// Only to be called with good y coordinates (after a bv::metrics)
+ bool needsFitCursor() const;
+
+ // Returns the amount of horizontal scrolling applied to the
+ // top-level row where the cursor lies
+ int horizScrollOffset() const;
+ // Returns the amount of horizontal scrolling applied to the
+ // row of text starting at (pit, pos)
+ int horizScrollOffset(Text const * text,
+ pit_type pit, pos_type pos) const;
+
+ // Returns true if the row of text starting at (pit, pos) was scrolled
+ // at the last draw event.
+ bool hadHorizScrollOffset(Text const * text,
+ pit_type pit, pos_type pos) const;
+
+ /// reset the scrollbar to reflect current view position.
+ void updateScrollbar();
+ /// return the Scrollbar Parameters.
+ ScrollbarParameters const & scrollbarParameters() const;
+ /// \return Tool tip for the given position.
+ docstring toolTip(int x, int y) const;
+ /// \return the context menu for the given position.
+ std::string contextMenu(int x, int y) const;
+
+ /// Save the current position as bookmark.
+ /// if idx == 0, save to temp_bookmark
+ void saveBookmark(unsigned int idx);
+ /// goto a specified position, try top_id first, and then bottom_pit.
+ /// \return true if success
+ bool moveToPosition(
+ pit_type bottom_pit, ///< Paragraph pit, used when par_id is zero or invalid.
+ pos_type bottom_pos, ///< Paragraph pit, used when par_id is zero or invalid.
+ int top_id, ///< Paragraph ID, \sa Paragraph
+ pos_type top_pos ///< Position in the \c Paragraph
+ );
+ /// return the current change at the cursor.
+ Change const getCurrentChange() const;
+
+ /// move cursor to the named label.
+ void gotoLabel(docstring const & label);
+
+ /// set the cursor based on the given TeX source row.
+ bool setCursorFromRow(int row);
+ /// set the cursor based on the given start and end TextEntries.
+ bool setCursorFromEntries(TexRow::TextEntry start, TexRow::TextEntry end);
+
+ /// set cursor to the given inset. Return true if found.
+ bool setCursorFromInset(Inset const *);
+ /// Recenters the BufferView such that the passed cursor
+ /// is in the center.
+ void recenter();
+ /// Ensure that the BufferView cursor is visible.
+ /// This method will automatically scroll and update the BufferView
+ /// (metrics+drawing) if needed.
+ void showCursor();
+ /// Ensure the passed cursor \p dit is visible.
+ /// This method will automatically scroll and update the BufferView
+ /// (metrics+drawing) if needed.
+ /// \param recenter Whether the cursor should be centered on screen
+ void showCursor(DocIterator const & dit, bool recenter,
+ bool update);
+ /// Scroll to the cursor.
+ void scrollToCursor();
+ /// Scroll to the cursor.
+ /// \param recenter Whether the cursor should be centered on screen
+ bool scrollToCursor(DocIterator const & dit, bool recenter);
+ /// scroll down document by the given number of pixels.
+ int scrollDown(int pixels);
+ /// scroll up document by the given number of pixels.
+ int scrollUp(int pixels);
+ /// scroll document by the given number of pixels.
+ int scroll(int pixels);
+ /// Scroll the view by a number of pixels.
+ void scrollDocView(int pixels, bool update);
+ /// Set the cursor position based on the scrollbar one.
+ void setCursorFromScrollbar();
+
+ /// return the pixel width of the document view.
+ int workWidth() const;
+ /// return the pixel height of the document view.
+ int workHeight() const;