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