]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/dlg/lengthentry.h
the rest read the ChangeLog, hope I remembered all
[lyx.git] / src / frontends / kde / dlg / lengthentry.h
1 // -*- C++ -*-
2 /*
3  * lengthentry.h
4  * (C) 2001 LyX Team
5  * John Levon, moz@compsoc.man.ac.uk
6  */
7
8 /***************************************************************************
9  *                                                                         *
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.                                   *
14  *                                                                         *
15  ***************************************************************************/
16
17 #ifndef LENGTHENTRY_H
18 #define LENGTHENTRY_H
19
20 #include <qwidget.h>
21
22 #include "vspace.h"
23
24 class QVBoxLayout;
25 class KRestrictedLine;
26 class QComboBox;
27
28 #include "boost/utility.hpp"
29
30 /**
31  * This widget provides a value edit and a combo box
32  * for LyXLengths.
33  */
34 class LengthEntry : public QWidget, boost::noncopyable {
35    Q_OBJECT
36 public:
37         LengthEntry(QWidget * parent = 0, const char * name = 0);
38         
39         ~LengthEntry();
40
41         /// get length string represented
42         const string getLengthStr() const; 
43
44         /// get the value
45         double getValue() const;
46
47         /// get the units as a string
48         const string getStrUnits() const;
49
50         /// get the units as a UNIT
51         LyXLength::UNIT getUnits() const;
52
53         /// set from a length string
54         bool setFromLengthStr(const string & str);
55
56         /// set the value
57         void setValue(double value);
58
59         /// set the value by a string 
60         void setValue(const string & str);
61
62         /// set the units from string e.g. "mm"
63         bool setUnits(const string & str);
64  
65         /// set the units from a UNIT
66         bool setUnits(LyXLength::UNIT unit);
67
68         /// enable/disable
69         virtual void setEnabled(bool enable);
70
71 private:
72         KRestrictedLine *value;
73         QComboBox *box;
74         QVBoxLayout *topLayout;
75 };
76
77 #endif