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"
25 explicit LyXGlueLength(LyXLength const & len);
27 LyXGlueLength(LyXLength const & len,
28 LyXLength const & plus,
29 LyXLength const & minus);
31 /** "data" must be a decimal number, followed by a unit, and
32 optional "glue" indicated by "+" and "-". You may abbreviate
34 1.2 cm // 4mm +2pt // 2cm -4mm +2mm // 4+0.1-0.2cm
35 The traditional Latex format is also accepted, like
36 4cm plus 10pt minus 10pt */
37 explicit LyXGlueLength(std::string const & data);
40 LyXLength const & len() const;
42 LyXLength const & plus() const;
44 LyXLength const & minus() const;
48 std::string const asString() const;
50 std::string const asLatexString() const;
52 friend bool isValidGlueLength(std::string const & data,
53 LyXGlueLength* result);
65 bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2);
67 bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
68 /** If "data" is valid, the length represented by it is
69 stored into "result", if that is not 0. */
70 bool isValidGlueLength(std::string const & data, LyXGlueLength * result = 0);
72 #endif // LYXGLUELENGTH_H