namespace lyx {
+class DocIterator;
+
/**
* An on-screen row of text. A paragraph is broken into a
* RowList for display. Each Row contains position pointers
///
Row();
///
- Row(pos_type pos);
- ///
bool changed() const { return changed_; }
///
void setChanged(bool c) { changed_ = c; }
///
void setCrc(size_type crc) const;
- ///
- void setSelection(pos_type sel_beg, pos_type sel_end);
-
+ /// 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);
///
/// the x position of the row
double x;
///
- pos_type sel_beg;
+ mutable pos_type sel_beg;
///
- pos_type sel_end;
+ 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?
mutable bool changed_;
/// CRC of row contents.