]> git.lyx.org Git - lyx.git/blob - src/vspace.h
fix typo that put too many include paths for most people
[lyx.git] / src / vspace.h
1 // -*- C++ -*-
2 /**
3  * \file vspace.h
4  * Copyright 1995-2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author Matthias Ettrich
8  */
9
10 #ifndef VSPACE_H
11 #define VSPACE_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "lyxgluelength.h"
18
19 #include "LString.h"
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                 NONE, ///< no added vertical space
31                 DEFSKIP,
32                 SMALLSKIP,
33                 MEDSKIP,
34                 BIGSKIP,
35                 VFILL,
36                 LENGTH ///< user-defined length
37         };
38
39         VSpace();
40
41         explicit VSpace(vspace_kind k);
42
43         explicit VSpace(LyXLength const & l);
44
45         explicit VSpace(LyXGlueLength const & l);
46
47         /// Constructor for reading from a .lyx file
48         explicit VSpace(string const & data);
49
50         /// return the type of vertical space
51         vspace_kind kind() const;
52         /// return the length of this space
53         LyXGlueLength length() const;
54
55         // a flag that switches between \vspace and \vspace*
56         bool keep() const;
57         /// if set true, use \vspace* when type is not DEFSKIP
58         void setKeep(bool val);
59         ///
60         bool operator==(VSpace const &) const;
61
62         // conversion
63
64         /// how it goes into the LyX file
65         string const asLyXCommand() const;
66         /// the latex representation
67         string const asLatexCommand(BufferParams const & params) const;
68         /// the size of the space on-screen
69         int inPixels(BufferView * bv) const;
70 private:
71         /// This VSpace kind
72         vspace_kind kind_;
73         /// the specified length
74         LyXGlueLength len_;
75         /// if true, use \vspace* type
76         bool keep_;
77 };
78
79 #endif