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"
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(string const & data);
43 LyXLength const & len() const;
45 LyXLength const & plus() const;
47 LyXLength const & minus() const;
51 string const asString() const;
53 string const asLatexString() const;
56 /** If "data" is valid, the length represented by it is
57 stored into "result", if that is not 0. */
58 friend bool isValidGlueLength(string const & data,
59 LyXGlueLength* result = 0);
71 bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2);
73 bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
75 bool isValidGlueLength(string const & data, LyXGlueLength * result);
77 #endif // LYXGLUELENGTH_H