]> git.lyx.org Git - lyx.git/blob - src/lyxrow.h
b6e036bbf9deb10901c2c457c89995b793f3b6f3
[lyx.git] / src / lyxrow.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2001 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYXROW_H
13 #define LYXROW_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "support/types.h"
20
21 class Paragraph;
22
23 ///
24 class Row {
25 public:
26         /// A position in the row
27         typedef lyx::pos_type pos_type;
28         ///
29         Row();
30         ///
31         void par(Paragraph * p);
32         ///
33         Paragraph * par();
34         ///
35         Paragraph * par() const;
36         ///
37         void pos(pos_type p);
38         ///
39         pos_type pos() const;
40         ///
41         void fill(int f);
42         ///
43         int fill() const;
44         ///
45         void height(unsigned short h);
46         ///
47         unsigned short height() const;
48         ///
49         void width(unsigned int w);
50         ///
51         unsigned int width() const;
52         ///
53         void ascent_of_text(unsigned short a);
54         ///
55         unsigned short ascent_of_text() const;
56         ///
57         void baseline(unsigned int b);
58         ///
59         unsigned int baseline() const;
60         ///
61         void next(Row * r);
62         ///
63         Row * next() const;
64         ///
65         void previous(Row * r);
66         ///
67         Row * previous() const;
68 private:
69         ///
70         Paragraph * par_;
71         ///
72         pos_type pos_;
73         /** what is missing to a full row can be negative.
74           Needed for hfills, flushright, block etc. */
75         mutable int fill_;
76         ///
77         unsigned short height_;
78         ///
79         unsigned int width_;
80         ///
81         unsigned short ascent_of_text_;
82         ///
83         unsigned int baseline_;
84         ///
85         Row * next_;
86         ///
87         Row * previous_;
88 };
89
90
91 inline
92 Paragraph * Row::par()
93 {
94         return par_;
95 }
96
97
98 inline
99 Paragraph * Row::par() const
100 {
101         return par_;
102 }
103
104
105 inline
106 unsigned short Row::height() const
107 {
108         return height_;
109 }
110
111
112 inline
113 Row * Row::next() const
114 {
115         return next_;
116 }
117
118 #endif