]> git.lyx.org Git - lyx.git/blobdiff - src/Row.h
New \cite_engine_type default.
[lyx.git] / src / Row.h
index 6d57857680ccb84ac71c44bc9f42fbe4672661cc..c26752bde861c7c557630cc3ba41938612dc242b 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -5,7 +5,7 @@
  * Licence details can be found in the file COPYING.
  *
  * \author Matthias Ettrich
- * \author Lars Gullik Bjønnes
+ * \author Lars Gullik Bjønnes
  *
  * Full author contact details are available in file CREDITS.
  *
@@ -22,6 +22,8 @@
 
 namespace lyx {
 
+class DocIterator;
+
 /**
  * An on-screen row of text. A paragraph is broken into a
  * RowList for display. Each Row contains position pointers
@@ -32,11 +34,24 @@ public:
        ///
        Row();
        ///
-       Row(pos_type pos);
-       ///
        bool changed() const { return changed_; }
        ///
-       void setCrc(size_type crc);
+       void setChanged(bool c) { changed_ = c; }
+       ///
+       void setCrc(size_type crc) const;
+       /// Set the selection begin and end.
+       /**
+         * This is const because we update the selection status only at draw()
+         * time.
+         */
+       void setSelection(pos_type sel_beg, pos_type sel_end) const;
+       ///
+       bool selection() const;
+       /// Set the selection begin and end and whether the left and/or right
+       /// margins are selected.
+       void setSelectionAndMargins(DocIterator const & beg, 
+               DocIterator const & end) const;
+       
        ///
        void pos(pos_type p);
        ///
@@ -59,22 +74,37 @@ public:
        int descent() const { return dim_.des; }
 
        /// current debugging only
-       void dump(const char * = "") const;
+       void dump(char const * = "") const;
 
        /// width of a separator (i.e. space)
        double separator;
-       /// width of hfills in the body
-       double hfill;
        /// width of hfills in the label
        double label_hfill;
        /// the x position of the row
        double x;
+       ///
+       mutable pos_type sel_beg;
+       ///
+       mutable pos_type sel_end;
+       ///
+       mutable bool begin_margin_sel;
+       ///
+       mutable bool end_margin_sel;
 
 private:
+       /// Decides whether the margin is selected.
+       /**
+         * \param margin_begin
+         * \param beg
+         * \param end
+         */
+       bool isMarginSelected(bool left_margin, DocIterator const & beg,
+               DocIterator const & end) const;
+
        /// has the Row appearance changed since last drawing?
-       bool changed_;
+       mutable bool changed_;
        /// CRC of row contents.
-       size_type crc_;
+       mutable size_type crc_;
        /// first pos covered by this row
        pos_type pos_;
        /// one behind last pos covered by this row