5 * John Levon, moz@compsoc.man.ac.uk
8 /***************************************************************************
10 * This program is free software; you can redistribute it and/or modify *
11 * it under the terms of the GNU General Public License as published by *
12 * the Free Software Foundation; either version 2 of the License, or *
13 * (at your option) any later version. *
15 ***************************************************************************/
25 class KRestrictedLine;
28 #include "boost/utility.hpp"
31 * This widget provides a value edit and a combo box
34 class LengthEntry : public QWidget, boost::noncopyable {
37 LengthEntry(QWidget * parent = 0, const char * name = 0);
41 /// get length string represented
42 const string getLengthStr() const;
45 double getValue() const;
47 /// get the units as a string
48 const string getStrUnits() const;
50 /// get the units as a UNIT
51 LyXLength::UNIT getUnits() const;
53 /// set from a length string
54 bool setFromLengthStr(const string & str);
57 void setValue(double value);
59 /// set the value by a string
60 void setValue(const string & str);
62 /// set the units from string e.g. "mm"
63 bool setUnits(const string & str);
65 /// set the units from a UNIT
66 bool setUnits(LyXLength::UNIT unit);
69 virtual void setEnabled(bool enable);
72 KRestrictedLine *value;
74 QVBoxLayout *topLayout;