]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.h
Fulfill promise to Andre: TextClass_ptr --> TextClassPtr.
[lyx.git] / src / ParagraphMetrics.h
index 72666da2cfec0c688a02b48d174ae9fef4e8802a..69ac74df417aa567bef66a8a8e841b059ca1ee87 100644 (file)
@@ -17,7 +17,9 @@
 #ifndef PARAGRAPH_METRICS_H
 #define PARAGRAPH_METRICS_H
 
+#include "Dimension.h"
 #include "Paragraph.h"
+#include "Row.h"
 
 namespace lyx {
 
@@ -40,11 +42,10 @@ public:
        ParagraphMetrics(Paragraph const & par);
 
        /// Copy operator.
-       /// Important note: We don't copy \c row_change_status_ and
-       /// \c row_signature_ because those are updated externally with
-       /// \c updateRowChangeStatus() in TextMetrics::redoParagraph().
        ParagraphMetrics & operator=(ParagraphMetrics const &);
 
+       void reset(Paragraph const & par);
+
        ///
        Row & getRow(pos_type pos, bool boundary);
        ///
@@ -56,22 +57,17 @@ public:
        Dimension const & dim() const { return dim_; }
        Dimension & dim() { return dim_; }
        /// total height of paragraph
-       unsigned int height() const { return dim_.height(); }
+       int height() const { return dim_.height(); }
        /// total width of paragraph, may differ from workwidth
-       unsigned int width() const { return dim_.width(); }
+       int width() const { return dim_.width(); }
        /// ascend of paragraph above baseline
-       unsigned int ascent() const { return dim_.ascent(); }
+       int ascent() const { return dim_.ascent(); }
        /// descend of paragraph below baseline
-       unsigned int descent() const { return dim_.descent(); }
+       int descent() const { return dim_.descent(); }
        /// Text updates the rows using this access point
        RowList & rows() { return rows_; }
        /// The painter and others use this
        RowList const & rows() const { return rows_; }
-       /// The painter and others use this
-       std::vector<bool> const & rowChangeStatus() const
-       { return row_change_status_; }
-       ///
-       void updateRowChangeStatus();
        ///
        int rightMargin(Buffer const & buffer) const;
        ///
@@ -80,17 +76,22 @@ public:
        /// dump some information to lyxerr
        void dump() const;
 
-private:
-       ///
-       typedef std::vector<size_type> RowSignature;
        ///
-       size_type calculateRowSignature(Row const &);
+       bool hfillExpansion(Row const & row, pos_type pos) const;
+
+       /// 
+       void computeRowSignature(Row &, BufferParams const & bparams);
+
        ///
-       mutable RowList rows_;
+       int position() const { return position_; }
+       void setPosition(int position);
+
+
+private:
        ///
-       RowSignature row_signature_;
+       int position_;
        ///
-       std::vector<bool> row_change_status_;
+       mutable RowList rows_;
        /// cached dimensions of paragraph
        Dimension dim_;
        ///