Add missing include, due to André LASSERT change
[lyx.git] / src / VSpace.h
blobb982b939f9bbab10e53e4ee147f15b0f663243a3
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.
7 * \author Matthias Ettrich
9 * Full author contact details are available in file CREDITS.
12 #ifndef VSPACE_H
13 #define VSPACE_H
15 #include "Length.h"
18 namespace lyx {
21 class BufferParams;
22 class BufferView;
25 /// A class representing latex vertical spacing
26 class VSpace {
27 public:
28 /// The different kinds of spaces.
29 enum VSpaceKind {
30 DEFSKIP,
31 SMALLSKIP,
32 MEDSKIP,
33 BIGSKIP,
34 VFILL,
35 LENGTH ///< user-defined length
38 ///
39 VSpace();
40 ///
41 explicit VSpace(VSpaceKind k);
42 ///
43 explicit VSpace(Length const & l);
44 ///
45 explicit VSpace(GlueLength const & l);
47 /// Constructor for reading from a .lyx file
48 explicit VSpace(std::string const & data);
50 /// return the type of vertical space
51 VSpaceKind kind() const { return kind_; }
52 /// return the length of this space
53 GlueLength const & length() const { return len_; }
55 // a flag that switches between \vspace and \vspace*
56 bool keep() const { return keep_; }
57 /// if set true, use \vspace* when type is not DEFSKIP
58 void setKeep(bool keep) { keep_ = keep; }
59 ///
60 bool operator==(VSpace const &) const;
62 // conversion
64 /// how it goes into the LyX file
65 std::string const asLyXCommand() const;
66 /// the latex representation
67 std::string const asLatexCommand(BufferParams const & params) const;
68 /// how it is seen in the LyX window
69 docstring const asGUIName() const;
70 /// the size of the space on-screen
71 int inPixels(BufferView const & bv) const;
73 private:
74 /// This VSpace kind
75 VSpaceKind kind_;
76 /// the specified length
77 GlueLength len_;
78 /// if true, use \vspace* type
79 bool keep_;
83 } // namespace lyx
85 #endif // VSPACE_H