]> git.lyx.org Git - lyx.git/blob - src/Spacing.h
paragraph-spacing, redoparagraph in deleteemptyparagraphmechanism, got rid of some...
[lyx.git] / src / Spacing.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-2000 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef SPACING_H
13 #define SPACING_H
14
15 #include <iosfwd>
16
17 ///
18 class Spacing {
19 public:
20         ///
21         enum Space {
22                 ///
23                 Single,
24                 ///
25                 Onehalf,
26                 ///
27                 Double,
28                 ///
29                 Other,
30                 ///
31                 Default
32         };
33         ///
34         Spacing() : space(Single), value(1.0) {}
35         ///
36         bool isDefault() const {
37                 return space == Default;
38         }
39         ///
40         float getValue() const;
41         ///
42         Spacing::Space getSpace() const { return space; }
43         ///
44         void set(Spacing::Space sp, float val = 1.0);
45         ///
46         void set(Spacing::Space sp, char const * val) ;
47         ///
48         void writeFile(std::ostream &, bool para = false) const;
49         ///
50         friend bool operator==(Spacing const & a, Spacing const & b) {
51                 if (a.space == b.space && a.getValue() == b.getValue())
52                         return true;
53                 return false;
54         }
55         ///
56         friend bool operator!=(Spacing const & a, Spacing const & b) {
57                 if (a.space == b.space && a.getValue() == b.getValue())
58                         return false;
59                 return true;
60         }
61 private:
62         ///
63         Space space;
64         ///
65         float value;
66 };
67 #endif