]> git.lyx.org Git - lyx.git/blobdiff - src/TextMetrics.h
Revert 23154.
[lyx.git] / src / TextMetrics.h
index 1d6f479bc62bcf323fcb57b238f6f31646620b80..617b716865dd01b9cd1579f2635ac3a3398d81c2 100644 (file)
 #define TEXT_METRICS_H
 
 #include "Font.h"
-// FIXME: We only need Point class definition, not the full CoordCache.
-#include "CoordCache.h"
 #include "ParagraphMetrics.h"
 
 #include "support/types.h"
 
-#include <boost/tuple/tuple.hpp>
-
 namespace lyx {
 
 class BufferView;
@@ -128,17 +124,19 @@ public:
        
        void drawParagraph(PainterInfo & pi, pit_type pit, int x, int y) const;
 
+       /// Returns the height of the row (width member is set to 0).
+       /// If \c topBottomSpace is true, extra space is added for the
+       /// top and bottom row.
+       Dimension rowHeight(
+               pit_type const pit,
+               pos_type const first,
+               pos_type const end,
+               bool topBottomSpace = true) const;
+
 private:
        ///
        ParagraphMetrics & parMetrics(pit_type, bool redo_paragraph);
 
-       /// draw textselection.
-       /// FIXME: simplify to just to single row painting.
-       void drawSelection(PainterInfo & pi,
-               DocIterator const & beg, ///< selection begin.
-               DocIterator const & end, ///< selection end.
-               int x) const;
-
        /// the minimum space a manual label needs on the screen in pixels
        int labelFill(pit_type const pit, Row const & row) const;
 
@@ -153,7 +151,7 @@ private:
                pit_type first
                ) const;
 
-       /// sets row.width to the minimum space a row needs on the screen in pixel
+       /// returns the minimum space a row needs on the screen in pixel
        int rowWidth(
                int right_margin,
                pit_type const pit,
@@ -161,13 +159,6 @@ private:
                pos_type const end
                ) const;
 
-       /// Calculate and set the height of the row
-       boost::tuple<int, int> rowHeight(
-               pit_type const pit,
-               pos_type const first,
-               pos_type const end
-               ) const;
-
        /// draw selection for a single row
        void drawRowSelection(PainterInfo & pi, int x, Row const & row,
                DocIterator const & beg, DocIterator const & end, 
@@ -253,6 +244,7 @@ public:
        int leftMargin(int max_width, pit_type pit) const;
 
 private:
+       friend class BufferView;
 
        /// The BufferView owner.
        BufferView * bv_;