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"
27 Row(Paragraph * pa, lyx::pos_type po);
29 void par(Paragraph * p);
33 Paragraph * par() const;
35 void pos(lyx::pos_type p);
37 lyx::pos_type pos() const;
43 void height(unsigned short h);
45 unsigned short height() const;
47 void width(unsigned int w);
49 unsigned int width() const;
51 void ascent_of_text(unsigned short a);
53 unsigned short ascent_of_text() const;
55 void top_of_text(unsigned int top);
57 unsigned int top_of_text() const;
59 void baseline(unsigned int b);
61 unsigned int baseline() const;
67 void previous(Row * r);
69 Row * previous() const;
71 /// return true if this row is the start of a paragraph
72 bool isParStart() const;
74 /// return true if this row is the end of a paragraph
75 bool isParEnd() const;
77 /// return the position of the last character in this row
78 lyx::pos_type lastPos() const;
79 /// return the position of the last normal, printable character in this row
80 lyx::pos_type lastPrintablePos() const;
83 * Returns the number of separators.
84 * The separator on the very last column doesnt count.
86 int numberOfSeparators() const;
89 * Returns the number of hfills. It works like a LaTeX \hfill:
90 * the hfills at the beginning and at the end are ignored.
91 * This is much more useful than not to ignore!
93 int numberOfHfills() const;
95 /// Returns the number of hfills in the manual label. See numberOfHfills().
96 int numberOfLabelHfills() const;
99 * Returns true if a expansion is needed at the given position.
100 * Rules are given by LaTeX
102 bool hfillExpansion(lyx::pos_type pos) const;
109 /** what is missing to a full row can be negative.
110 Needed for hfills, flushright, block etc. */
113 unsigned short height_;
116 /// ascent from baseline including prelude space
117 unsigned short ascent_of_text_;
118 /// the top of the real text in the row
119 unsigned int top_of_text_;
121 unsigned int baseline_;