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
14 #include "lyxlength.h"
24 explicit LyXGlueLength(LyXLength const & len);
26 LyXGlueLength(LyXLength const & len,
27 LyXLength const & plus,
28 LyXLength const & minus);
30 /** "data" must be a decimal number, followed by a unit, and
31 optional "glue" indicated by "+" and "-". You may abbreviate
33 1.2 cm // 4mm +2pt // 2cm -4mm +2mm // 4+0.1-0.2cm
34 The traditional Latex format is also accepted, like
35 4cm plus 10pt minus 10pt */
36 explicit LyXGlueLength(string const & data);
39 LyXLength const & len() const;
41 LyXLength const & plus() const;
43 LyXLength const & minus() const;
47 string const asString() const;
49 string const asLatexString() const;
51 friend bool isValidGlueLength(string const & data,
52 LyXGlueLength* result);
64 bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2);
66 bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
67 /** If "data" is valid, the length represented by it is
68 stored into "result", if that is not 0. */
69 bool isValidGlueLength(string const & data, LyXGlueLength * result = 0);
71 #endif // LYXGLUELENGTH_H