]> git.lyx.org Git - lyx.git/blob - src/vspace.h
Fix fuer #209
[lyx.git] / src / vspace.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 VSPACE_H
13 #define VSPACE_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "lyxgluelength.h"
20
21 #include "LString.h"
22
23 class BufferParams;
24 class BufferView;
25
26
27 ///
28 class VSpace {
29 public:
30         /// The different kinds of spaces.
31         enum vspace_kind {
32                 ///
33                 NONE,
34                 ///
35                 DEFSKIP,
36                 ///
37                 SMALLSKIP,
38                 ///
39                 MEDSKIP,
40                 ///
41                 BIGSKIP,
42                 ///
43                 VFILL,
44                 ///
45                 LENGTH
46         };
47         /// Constructor
48         VSpace();
49         /// Constructor
50         explicit VSpace(vspace_kind k);
51         /// Constructor
52         explicit VSpace(LyXLength const & l);
53         /// Constructor
54         explicit VSpace(LyXGlueLength const & l);
55
56         /// Constructor for reading from a .lyx file
57         explicit VSpace(string const & data);
58         
59         /// access functions
60         vspace_kind kind() const;
61         ///
62         LyXGlueLength length() const;
63
64         // a flag that switches between \vspace and \vspace*
65         bool keep() const;
66         ///
67         void setKeep(bool val);
68         ///
69         bool operator==(VSpace const &) const;
70
71         // conversion
72         /// how it goes into the LyX file
73         string const asLyXCommand() const; 
74         ///
75         string const asLatexCommand(BufferParams const & params) const;
76         ///
77         int inPixels(BufferView * bv) const;
78 private:
79         /// This VSpace kind
80         vspace_kind kind_;
81         ///
82         LyXGlueLength len_;
83         ///
84         bool keep_;
85 };
86
87 #endif