2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-04-26 03:53:02 +00:00
|
|
|
* \file LengthCombo.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LENGTHCOMBO_H
|
|
|
|
#define LENGTHCOMBO_H
|
|
|
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
2015-07-18 14:29:04 +00:00
|
|
|
#include "Length.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2012-12-17 20:13:40 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/**
|
2007-04-28 12:58:49 +00:00
|
|
|
* A combo box for selecting Length::UNIT types.
|
2006-03-05 17:24:44 +00:00
|
|
|
*/
|
|
|
|
class LengthCombo : public QComboBox {
|
|
|
|
Q_OBJECT
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
public:
|
|
|
|
LengthCombo(QWidget * parent);
|
|
|
|
|
|
|
|
/// set the current item from unit
|
2015-07-18 14:23:24 +00:00
|
|
|
void setCurrentItem(lyx::Length::UNIT unit);
|
2009-01-14 12:57:23 +00:00
|
|
|
/// set the current item from length string
|
2012-05-28 20:41:32 +00:00
|
|
|
virtual void setCurrentItem(QString const & item);
|
2006-03-05 17:24:44 +00:00
|
|
|
/// set the current item from int
|
|
|
|
virtual void setCurrentItem(int item);
|
|
|
|
/// get the current item
|
2007-04-28 12:58:49 +00:00
|
|
|
lyx::Length::UNIT currentLengthItem() const;
|
2006-03-05 17:24:44 +00:00
|
|
|
/// enable the widget
|
|
|
|
virtual void setEnabled(bool b);
|
|
|
|
/// use the %-items?
|
2015-07-18 14:23:24 +00:00
|
|
|
void noPercents();
|
2015-07-18 14:41:52 +00:00
|
|
|
/// Remove EM, EX and MU units
|
|
|
|
void removeFontDependent();
|
2009-01-14 10:20:33 +00:00
|
|
|
/// remove a unit from the combo
|
2015-07-18 14:23:24 +00:00
|
|
|
void removeUnit(lyx::Length::UNIT unit);
|
2009-01-14 10:20:33 +00:00
|
|
|
/// add a unit to the combo
|
2015-07-18 14:23:24 +00:00
|
|
|
void addUnit(lyx::Length::UNIT unit);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
protected Q_SLOTS:
|
2009-05-23 09:28:33 +00:00
|
|
|
virtual void hasActivated(int index);
|
2006-06-30 14:37:33 +00:00
|
|
|
Q_SIGNALS:
|
2006-03-05 17:24:44 +00:00
|
|
|
/// the current selection has changed
|
2007-04-28 12:58:49 +00:00
|
|
|
void selectionChanged(lyx::Length::UNIT unit);
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2017-07-23 11:11:54 +00:00
|
|
|
} // namespace frontend
|
2012-12-17 20:13:40 +00:00
|
|
|
} // namespace lyx
|
2006-10-21 00:16:43 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
#endif // LENGTHCOMBO_H
|