3 * \file lyxgluelength.h
4 * Copyright 1995-2002 the LyX Team
5 * Read the file COPYING
7 * \author Matthias Ettrich
11 #ifndef LYX_GLUE_LENGTH_H
12 #define LYX_GLUE_LENGTH_H
18 #include "lyxlength.h"
31 explicit LyXGlueLength(LyXLength const & len);
33 LyXGlueLength(LyXLength const & len,
34 LyXLength const & plus,
35 LyXLength const & minus);
37 /** "data" must be a decimal number, followed by a unit, and
38 optional "glue" indicated by "+" and "-". You may abbreviate
40 1.2 cm // 4mm +2pt // 2cm -4mm +2mm // 4+0.1-0.2cm
41 The traditional Latex format is also accepted, like
42 4cm plus 10pt minus 10pt */
43 explicit LyXGlueLength(string const & data);
46 LyXLength const & len() const;
48 LyXLength const & plus() const;
50 LyXLength const & minus() const;
54 string const asString() const;
56 string const asLatexString() const;
59 /** If "data" is valid, the length represented by it is
60 stored into "result", if that is not 0. */
61 friend bool isValidGlueLength(string const & data,
62 LyXGlueLength* result = 0);
74 bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2);
76 bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
78 bool isValidGlueLength(string const & data, LyXGlueLength * result);
80 #endif // LYXGLUELENGTH_H