]> git.lyx.org Git - lyx.git/blobdiff - src/BufferView.h
Final fix to get unit with optional arg (value) working
[lyx.git] / src / BufferView.h
index 4217901c908fbda3182d045ca6932952c4a19fd8..5b726d8c5af19792815dd2bc987eb693c03c0fcc 100644 (file)
@@ -24,7 +24,7 @@
 #include "support/types.h"
 
 #include <boost/tuple/tuple.hpp>
-#include <boost/utility.hpp>
+#include <boost/noncopyable.hpp>
 #include <boost/signal.hpp>
 
 #include <utility>
@@ -48,6 +48,12 @@ class Text;
 class ParIterator;
 class ParagraphMetrics;
 class ViewMetricsInfo;
+enum CursorStatus {
+       CUR_INSIDE,
+       CUR_ABOVE,
+       CUR_BELOW
+};
 
 /// Scrollbar Parameters.
 struct ScrollbarParameters
@@ -128,8 +134,12 @@ public:
 
        /// 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.
@@ -167,6 +177,8 @@ public:
        /// access to anchor.
        pit_type anchor_ref() const;
 
+       ///
+       CursorStatus cursorStatus(DocIterator const & dit) const;
        /// access to full cursor.
        Cursor & cursor();
        /// access to full cursor.
@@ -206,13 +218,13 @@ public:
        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);
@@ -245,6 +257,11 @@ public:
        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();