]> git.lyx.org Git - lyx.git/blob - src/Row.h
Transfer ParagraphMetrics::rowChangeStatus() to Row::changed(). Prepare for fine...
[lyx.git] / src / Row.h
1 // -*- C++ -*-
2 /**
3  * \file Row.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Matthias Ettrich
8  * \author Lars Gullik Bjønnes
9  *
10  * Full author contact details are available in file CREDITS.
11  *
12  * Metrics for an on-screen text row.
13  */
14
15 #ifndef ROW_H
16 #define ROW_H
17
18 #include "support/types.h"
19
20 #include "Dimension.h"
21
22
23 namespace lyx {
24
25 /**
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.
29  */
30 class Row {
31 public:
32         ///
33         Row();
34         ///
35         Row(pos_type pos);
36         ///
37         bool changed() const { return changed_; }
38         ///
39         void setCrc(size_type crc);
40         ///
41         void pos(pos_type p);
42         ///
43         pos_type pos() const { return pos_; }
44         ///
45         void endpos(pos_type p);
46         ///
47         pos_type endpos() const { return end_; }
48         ///
49         void setDimension(Dimension const & dim);
50         ///
51         Dimension const & dimension() const { return dim_; }
52         ///
53         int height() const { return dim_.height(); }
54         ///
55         int width() const { return dim_.wid; }
56         ///
57         int ascent() const { return dim_.asc; }
58         ///
59         int descent() const { return dim_.des; }
60
61         /// current debugging only
62         void dump(const char * = "") const;
63
64         /// width of a separator (i.e. space)
65         double separator;
66         /// width of hfills in the body
67         double hfill;
68         /// width of hfills in the label
69         double label_hfill;
70         /// the x position of the row
71         double x;
72
73 private:
74         /// has the Row appearance changed since last drawing?
75         bool changed_;
76         /// CRC of row contents.
77         size_type crc_;
78         /// first pos covered by this row
79         pos_type pos_;
80         /// one behind last pos covered by this row
81         pos_type end_;
82         /// Row dimension.
83         Dimension dim_;
84 };
85
86
87 } // namespace lyx
88
89 #endif