4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS
11 * Metrics for an on-screen text row.
17 #include "support/types.h"
28 void par(Paragraph * p);
32 Paragraph * par() const;
34 void pos(lyx::pos_type p);
36 lyx::pos_type pos() const;
42 void height(unsigned short h);
44 unsigned short height() const;
46 void width(unsigned int w);
48 unsigned int width() const;
50 void ascent_of_text(unsigned short a);
52 unsigned short ascent_of_text() const;
54 void top_of_text(unsigned int top);
56 unsigned int top_of_text() const;
58 void baseline(unsigned int b);
60 unsigned int baseline() const;
66 void previous(Row * r);
68 Row * previous() const;
70 /// return true if this row is the start of a paragraph
71 bool isParStart() const;
73 /// return true if this row is the end of a paragraph
74 bool isParEnd() const;
76 /// return the position of the last character in this row
77 lyx::pos_type lastPos() const;
78 /// return the position of the last normal, printable character in this row
79 lyx::pos_type lastPrintablePos() const;
82 * Returns the number of separators.
83 * The separator on the very last column doesnt count.
85 int numberOfSeparators() const;
88 * Returns the number of hfills. It works like a LaTeX \hfill:
89 * the hfills at the beginning and at the end are ignored.
90 * This is much more useful than not to ignore!
92 int numberOfHfills() const;
94 /// Returns the number of hfills in the manual label. See numberOfHfills().
95 int numberOfLabelHfills() const;
98 * Returns true if a expansion is needed at the given position.
99 * Rules are given by LaTeX
101 bool hfillExpansion(lyx::pos_type pos) const;
108 /** what is missing to a full row can be negative.
109 Needed for hfills, flushright, block etc. */
112 unsigned short height_;
115 /// ascent from baseline including prelude space
116 unsigned short ascent_of_text_;
117 /// the top of the real text in the row
118 unsigned int top_of_text_;
120 unsigned int baseline_;