3 * \file lyxgluelength.h
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
8 * \author Matthias Ettrich
9 * \author Jean-Marc Lasgouttes
11 * Full author contact details are available in file CREDITS.
14 #ifndef LYX_GLUE_LENGTH_H
15 #define LYX_GLUE_LENGTH_H
17 #include "lyxlength.h"
28 explicit LyXGlueLength(LyXLength const & len);
30 LyXGlueLength(LyXLength const & len,
31 LyXLength const & plus,
32 LyXLength const & minus);
34 /** "data" must be a decimal number, followed by a unit, and
35 optional "glue" indicated by "+" and "-". You may abbreviate
37 1.2 cm // 4mm +2pt // 2cm -4mm +2mm // 4+0.1-0.2cm
38 The traditional Latex format is also accepted, like
39 4cm plus 10pt minus 10pt */
40 explicit LyXGlueLength(std::string const & data);
43 LyXLength const & len() const;
45 LyXLength const & plus() const;
47 LyXLength const & minus() const;
51 std::string const asString() const;
53 std::string const asLatexString() const;
55 friend bool isValidGlueLength(std::string const & data,
56 LyXGlueLength* result);
68 bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2);
70 bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
71 /** If "data" is valid, the length represented by it is
72 stored into "result", if that is not 0. */
73 bool isValidGlueLength(std::string const & data, LyXGlueLength * result = 0);
78 #endif // LYXGLUELENGTH_H