]> git.lyx.org Git - lyx.git/blob - src/Spacing.h
4cfb02c5d09e3cf4db34460d9ec1d9aa77dcfde3
[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 using std::ostream;
18
19 ///
20 class Spacing {
21 public:
22         ///
23         enum Space {
24                 ///
25                 Single,
26                 ///
27                 Onehalf,
28                 ///
29                 Double,
30                 ///
31                 Other
32         };
33         ///
34         Spacing() {
35                 space = Single;
36                 value = getValue();
37         }
38         ///
39         float getValue() const;
40         ///
41         Spacing::Space getSpace() const { return space; }
42         ///
43         void set(Spacing::Space sp, float val = 1.0);
44         ///
45         void set(Spacing::Space sp, char const * val) ;
46         ///
47         void writeFile(ostream &) const;
48         ///
49         friend bool operator!=(Spacing const & a, Spacing const & b) {
50                 if (a.space == b.space && a.getValue() == b.getValue())
51                         return false;
52                 return true;
53         }
54 private:
55         ///
56         Space space;
57         ///
58         float value;
59 };
60 #endif