]> git.lyx.org Git - lyx.git/blob - src/frontends/qt4/LengthCombo.h
Fix the tab ordering of PanelStack and PrefsUi.
[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
22 /**
23  * A combo box for selecting Length::UNIT types.
24  */
25 class LengthCombo : public QComboBox {
26         Q_OBJECT
27
28 public:
29         LengthCombo(QWidget * parent);
30
31         /// set the current item from unit
32         virtual void setCurrentItem(lyx::Length::UNIT unit);
33         /// set the current item from length string
34         virtual void setCurrentItem(QString const item);
35         /// set the current item from int
36         virtual void setCurrentItem(int item);
37         /// get the current item
38         lyx::Length::UNIT currentLengthItem() const;
39         /// enable the widget
40         virtual void setEnabled(bool b);
41         /// use the %-items?
42         virtual void noPercents();
43         /// remove a unit from the combo
44         virtual void removeUnit(lyx::Length::UNIT unit);
45         /// add a unit to the combo
46         virtual void addUnit(lyx::Length::UNIT unit);
47
48 protected Q_SLOTS:
49         virtual void hasActivated(int index);
50 Q_SIGNALS:
51         /// the current selection has changed
52         void selectionChanged(lyx::Length::UNIT unit);
53 };
54
55
56 //} // namespace lyx
57
58 #endif // LENGTHCOMBO_H