2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
12 #ifndef LYX_GLUE_LENGTH_H
13 #define LYX_GLUE_LENGTH_H
19 #include "lyxlength.h"
32 explicit LyXGlueLength(LyXLength const & len);
34 LyXGlueLength(LyXLength const & len,
35 LyXLength const & plus,
36 LyXLength const & minus);
38 /** "data" must be a decimal number, followed by a unit, and
39 optional "glue" indicated by "+" and "-". You may abbreviate
41 1.2 cm // 4mm +2pt // 2cm -4mm +2mm // 4+0.1-0.2cm
42 The traditional Latex format is also accepted, like
43 4cm plus 10pt minus 10pt */
44 explicit LyXGlueLength(string const & data);
47 LyXLength const & len() const;
49 LyXLength const & plus() const;
51 LyXLength const & minus() const;
55 string const asString() const;
57 string const asLatexString() const;
60 /** If "data" is valid, the length represented by it is
61 stored into "result", if that is not 0. */
62 friend bool isValidGlueLength(string const & data,
63 LyXGlueLength* result = 0);
75 bool operator==(LyXGlueLength const & l1, LyXGlueLength const & l2);
77 bool operator!=(LyXGlueLength const & l1, LyXGlueLength const & l2);
79 bool isValidGlueLength(string const & data, LyXGlueLength * result);