4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Matthias Ettrich
8 * \author Lars Gullik Bjønnes
10 * Full author contact details are available in file CREDITS.
12 * Metrics for an on-screen text row.
18 #include "support/types.h"
20 #include "Dimension.h"
26 * An on-screen row of text. A paragraph is broken into a
27 * RowList for display. Each Row contains position pointers
28 * into the first and last character positions of that row.
37 bool changed() const { return changed_; }
39 void setChanged(bool c) { changed_ = c; }
41 void setCrc(size_type crc) const;
43 void setSelection(pos_type sel_beg, pos_type sel_end);
48 pos_type pos() const { return pos_; }
50 void endpos(pos_type p);
52 pos_type endpos() const { return end_; }
54 void setDimension(Dimension const & dim);
56 Dimension const & dimension() const { return dim_; }
58 int height() const { return dim_.height(); }
60 int width() const { return dim_.wid; }
62 int ascent() const { return dim_.asc; }
64 int descent() const { return dim_.des; }
66 /// current debugging only
67 void dump(char const * = "") const;
69 /// width of a separator (i.e. space)
71 /// width of hfills in the body
73 /// width of hfills in the label
75 /// the x position of the row
82 /// has the Row appearance changed since last drawing?
83 mutable bool changed_;
84 /// CRC of row contents.
85 mutable size_type crc_;
86 /// first pos covered by this row
88 /// one behind last pos covered by this row