#include "support/types.h"
#include <boost/tuple/tuple.hpp>
-#include <boost/utility.hpp>
+#include <boost/noncopyable.hpp>
#include <boost/signal.hpp>
#include <utility>
class ParIterator;
class ParagraphMetrics;
class ViewMetricsInfo;
+
+enum CursorStatus {
+ CUR_INSIDE,
+ CUR_ABOVE,
+ CUR_BELOW
+};
/// Scrollbar Parameters.
struct ScrollbarParameters
/// center the document view around the cursor.
void center();
- /// scroll document by the given number of lines of default height.
- void scroll(int lines);
+ /// scroll down document by the given number of pixels.
+ void scrollDown(int pixels);
+ /// scroll up document by the given number of pixels.
+ void scrollUp(int pixels);
+ /// scroll document by the given number of pixels.
+ void scroll(int pixels);
/// Scroll the view by a number of pixels.
void scrollDocView(int pixels);
/// Set the cursor position based on the scrollbar one.
/// access to anchor.
pit_type anchor_ref() const;
+ ///
+ CursorStatus cursorStatus(DocIterator const & dit) const;
/// access to full cursor.
Cursor & cursor();
/// access to full cursor.
ParagraphMetrics const & parMetrics(Text const *, pit_type) const;
///
- CoordCache & coordCache() {
- return coord_cache_;
- }
+ CoordCache & coordCache() { return coord_cache_; }
///
- CoordCache const & coordCache() const {
- return coord_cache_;
- }
+ CoordCache const & coordCache() const { return coord_cache_; }
+
+ ///
+ Point getPos(DocIterator const & dit, bool boundary) const;
+
///
void draw(frontend::Painter & pain);
boost::signal<void(docstring layout)> layoutChanged;
private:
+ // the position relative to (0, baseline) of outermost paragraph
+ Point coordOffset(DocIterator const & dit, bool boundary) const;
+ /// Update current paragraph metrics.
+ /// \return true if no further update is needed.
+ bool singleParUpdate();
///
bool multiParSel();