* LengthCombo.{cpp,h}:
[lyx.git] / src / frontends / qt4 / LengthCombo.h
blob8d0a6823fc026202f9f7c20c22b61161492daf15
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.
7 * \author John Levon
9 * Full author contact details are available in file CREDITS.
12 #ifndef LENGTHCOMBO_H
13 #define LENGTHCOMBO_H
15 #include <QComboBox>
17 #include "VSpace.h"
20 //namespace lyx {
22 /**
23 * A combo box for selecting Length::UNIT types.
25 class LengthCombo : public QComboBox {
26 Q_OBJECT
28 public:
29 LengthCombo(QWidget * parent);
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);
48 protected Q_SLOTS:
49 virtual void has_activated(int index);
50 Q_SIGNALS:
51 /// the current selection has changed
52 void selectionChanged(lyx::Length::UNIT unit);
56 //} // namespace lyx
58 #endif // LENGTHCOMBO_H