]> git.lyx.org Git - lyx.git/blob - src/Spacing.h
some small stuff before the meeting begins for real
[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 #include "LString.h"
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                 Default
34         };
35         ///
36         Spacing() : space(Single), value(1.0) {}
37         ///
38         bool isDefault() const {
39                 return space == Default;
40         }
41         ///
42         float getValue() const;
43         ///
44         Spacing::Space getSpace() const { return space; }
45         ///
46         void set(Spacing::Space sp, float val = 1.0);
47         ///
48         void set(Spacing::Space sp, char const * val) ;
49         ///
50         void writeFile(std::ostream &, bool para = false) const;
51         ///
52         string writeEnvirBegin() const;
53         ///
54         string writeEnvirEnd() const;
55         ///
56         friend bool operator==(Spacing const & a, Spacing const & b) {
57                 return a.space == b.space && a.getValue() == b.getValue();
58         }
59         ///
60         friend bool operator!=(Spacing const & a, Spacing const & b) {
61                 return !(a == b);
62         }
63 private:
64         ///
65         Space space;
66         ///
67         float value;
68 };
69 #endif