]> git.lyx.org Git - lyx.git/blob - src/VSpace.h
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / VSpace.h
1 // -*- C++ -*-
2 /**
3  * \file VSpace.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  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef VSPACE_H
13 #define VSPACE_H
14
15 #include "Length.h"
16
17
18 namespace lyx {
19
20
21 class BufferParams;
22 class BufferView;
23
24
25 /// A class representing latex vertical spacing
26 class VSpace {
27 public:
28         /// The different kinds of spaces.
29         enum vspace_kind {
30                 DEFSKIP,
31                 SMALLSKIP,
32                 MEDSKIP,
33                 BIGSKIP,
34                 VFILL,
35                 LENGTH ///< user-defined length
36         };
37
38         VSpace();
39
40         explicit VSpace(vspace_kind k);
41
42         explicit VSpace(Length const & l);
43
44         explicit VSpace(GlueLength const & l);
45
46         /// Constructor for reading from a .lyx file
47         explicit VSpace(std::string const & data);
48
49         /// return the type of vertical space
50         vspace_kind kind() const;
51         /// return the length of this space
52         GlueLength const & length() const;
53
54         // a flag that switches between \vspace and \vspace*
55         bool keep() const;
56         /// if set true, use \vspace* when type is not DEFSKIP
57         void setKeep(bool val);
58         ///
59         bool operator==(VSpace const &) const;
60
61         // conversion
62
63         /// how it goes into the LyX file
64         std::string const asLyXCommand() const;
65         /// the latex representation
66         std::string const asLatexCommand(BufferParams const & params) const;
67         /// how it is seen in the LyX window
68         docstring const asGUIName() const;
69         /// the size of the space on-screen
70         int inPixels(BufferView const & bv) const;
71
72 private:
73         /// This VSpace kind
74         vspace_kind kind_;
75         /// the specified length
76         GlueLength len_;
77         /// if true, use \vspace* type
78         bool keep_;
79 };
80
81
82 } // namespace lyx
83
84 #endif // VSPACE_H