4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
16 #include "tex2lyx/Spacing.h"
19 #include "support/strfwd.h"
42 Spacing() : space(Default
), value("1.0") {}
44 Spacing(Spacing::Space sp
, double val
= 1.0) { set(sp
, val
); }
46 Spacing(Spacing::Space sp
, std::string
const & val
) { set(sp
, val
); }
48 bool isDefault() const { return space
== Default
; }
50 std::string
const getValueAsString() const;
52 double getValue() const;
54 Spacing::Space
getSpace() const { return space
; }
56 void set(Spacing::Space sp
, double val
= 1.0);
58 void set(Spacing::Space sp
, std::string
const & val
);
60 void writeFile(std::ostream
&, bool para
= false) const;
61 /// useSetSpace is true when using the variant supported by
63 std::string
const writeEnvirBegin(bool useSetSpace
) const;
64 /// useSetSpace is true when using the variant supported by
66 std::string
const writeEnvirEnd(bool useSetSpace
) const;
67 /// useSetSpace is true when using the variant supported by
69 std::string
const writePreamble(bool useSetSpace
) const;
76 /// names of line spacing
77 static std::string
const spacing_string
[];
83 bool operator==(Spacing
const & a
, Spacing
const & b
)
85 return a
.getSpace() == b
.getSpace()
86 && a
.getValueAsString() == b
.getValueAsString();
91 bool operator!=(Spacing
const & a
, Spacing
const & b
)