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.
15 #include "support/strfwd.h"
38 Spacing() : space(Default), value("1.0") {}
40 Spacing(Spacing::Space sp, double val = 1.0) { set(sp, val); }
42 Spacing(Spacing::Space sp, std::string const & val) { set(sp, val); }
44 bool isDefault() const { return space == Default; }
46 std::string const getValueAsString() const;
48 double getValue() const;
50 Spacing::Space getSpace() const { return space; }
52 void set(Spacing::Space sp, double val = 1.0);
54 void set(Spacing::Space sp, std::string const & val);
56 void writeFile(std::ostream &, bool para = false) const;
57 /// useSetSpace is true when using the variant supported by
59 std::string const writeEnvirBegin(bool useSetSpace) const;
60 /// useSetSpace is true when using the variant supported by
62 std::string const writeEnvirEnd(bool useSetSpace) const;
63 /// useSetSpace is true when using the variant supported by
65 std::string const writeCmd(bool useSetSpace) const;
66 /// useSetSpace is true when using the variant supported by
68 std::string const writePreamble(bool useSetSpace) const;
75 /// names of line spacing
76 static std::string const spacing_string[];
82 bool operator==(Spacing const & a, Spacing const & b)
84 return a.getSpace() == b.getSpace()
85 && a.getValueAsString() == b.getValueAsString();
90 bool operator!=(Spacing const & a, Spacing const & b)