]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
Transform the name of the temp dir on Windows with GetLongPathName.
[lyx.git] / src / lyxrow.h
1 // -*- C++ -*-
2 /**
3  * \file lyxrow.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 LYXROW_H
16 #define LYXROW_H
17
18 #include "support/types.h"
19
20 /**
21  * An on-screen row of text. A paragraph is broken into a 
22  * RowList for display. Each Row contains position pointers
23  * into the first and last character positions of that row.
24  */
25 class Row {
26 public:
27         ///
28         Row();
29         ///
30         Row(lyx::pos_type pos);
31         ///
32         void pos(lyx::pos_type p);
33         ///
34         lyx::pos_type pos() const;
35         ///
36         void endpos(lyx::pos_type p);
37         ///
38         lyx::pos_type endpos() const;
39         ///
40         int height() const { return ascent_ + descent_; }
41         ///
42         void width(int w);
43         ///
44         int width() const;
45         ///
46         void ascent(int b);
47         ///
48         int ascent() const;
49         ///
50         void descent(int b) { descent_ = b; }
51         ///
52         int descent() const { return descent_; }
53         /// current debugging only
54         void dump(const char * = "") const;
55
56 private:
57         /// first pos covered by this row
58         lyx::pos_type pos_;
59         /// one behind last pos covered by this row
60         lyx::pos_type end_;
61         ///
62         int ascent_;
63         ///
64         int descent_;
65         ///
66         int width_;
67 };
68
69
70 class RowMetrics {
71 public:
72         RowMetrics();
73         /// width of a separator (i.e. space)
74         double separator;
75         /// width of hfills in the body
76         double hfill;
77         /// width of hfills in the label
78         double label_hfill;
79         /// the x position of the row
80         double x;
81 };
82
83
84 #endif