]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/LengthCombo.h
On Linux show in crash message box the backtrace
[lyx.git] / src / frontends / qt4 / LengthCombo.h
1 // -*- C++ -*-
2 /**
3  * \file LengthCombo.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LENGTHCOMBO_H
13 #define LENGTHCOMBO_H
14
15 #include <QComboBox>
16
17 #include "VSpace.h"
18
19
20 namespace lyx {
21 namespace frontend {
22
23 /**
24  * A combo box for selecting Length::UNIT types.
25  */
26 class LengthCombo : public QComboBox {
27         Q_OBJECT
28
29 public:
30         LengthCombo(QWidget * parent);
31
32         /// set the current item from unit
33         virtual void setCurrentItem(lyx::Length::UNIT unit);
34         /// set the current item from length string
35         virtual void setCurrentItem(QString const & item);
36         /// set the current item from int
37         virtual void setCurrentItem(int item);
38         /// get the current item
39         lyx::Length::UNIT currentLengthItem() const;
40         /// enable the widget
41         virtual void setEnabled(bool b);
42         /// use the %-items?
43         virtual void noPercents();
44         /// remove a unit from the combo
45         virtual void removeUnit(lyx::Length::UNIT unit);
46         /// add a unit to the combo
47         virtual void addUnit(lyx::Length::UNIT unit);
48
49 protected Q_SLOTS:
50         virtual void hasActivated(int index);
51 Q_SIGNALS:
52         /// the current selection has changed
53         void selectionChanged(lyx::Length::UNIT unit);
54 };
55
56
57 } // namesapce frontend
58 } // namespace lyx
59
60 #endif // LENGTHCOMBO_H