4 * John Levon, moz@compsoc.man.ac.uk
7 /***************************************************************************
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
14 ***************************************************************************/
24 class KRestrictedLine;
27 #include "boost/utility.hpp"
30 * This widget provides a value edit and a combo box
33 class LengthEntry : public QWidget, public boost::noncopyable {
36 LengthEntry(QWidget * parent = 0, const char * name = 0);
40 /// get length string represented
41 const string getLengthStr() const;
44 double getValue() const;
46 /// get the units as a string
47 const string getStrUnits() const;
49 /// get the units as a UNIT
50 LyXLength::UNIT getUnits() const;
52 /// set from a length string
53 bool setFromLengthStr(const string & str);
56 void setValue(double value);
58 /// set the value by a string
59 void setValue(const string & str);
61 /// set the units from string e.g. "mm"
62 bool setUnits(const string & str);
64 /// set the units from a UNIT
65 bool setUnits(LyXLength::UNIT unit);
68 virtual void setEnabled(bool enable);
71 KRestrictedLine *value;
73 QVBoxLayout *topLayout;