home *** CD-ROM | disk | FTP | other *** search
/ Clickx 115 / Clickx 115.iso / software / tools / windows / tails-i386-0.16.iso / live / filesystem.squashfs / usr / include / scribus-ng / scrspinbox.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-09-09  |  1.9 KB  |  60 lines

  1. /*
  2. For general Scribus (>=1.3.2) copyright and licensing information please refer
  3. to the COPYING file provided with the program. Following this notice may exist
  4. a copyright and/or license notice that predates the release of Scribus 1.3.2
  5. for which a new license (GPL+exception) is in place.
  6. */
  7. /***************************************************************************
  8.  *   Craig Bradney, cbradney@zip.com.au                                    *
  9.  ***************************************************************************/
  10.  
  11. #ifndef SCRSPINBOX
  12. #define SCRSPINBOX
  13.  
  14. #include <QDoubleSpinBox>
  15. #include <QLineEdit>
  16. #include <QWidget>
  17.  
  18. #include "scribusapi.h"
  19.  
  20. //!\brief ScrSpinBox is a Qt4 replacement for our old ScrSpinBox using Qt3
  21. class SCRIBUS_API ScrSpinBox : public QDoubleSpinBox
  22. {
  23.     Q_OBJECT
  24.     public:
  25.         ScrSpinBox(QWidget *parent, int unitIndex=0);
  26.         ScrSpinBox(double minValue, double maxValue, QWidget *pa, int unitIndex=0);
  27.         ~ScrSpinBox();
  28.         
  29.         //overridden members
  30.         double valueFromText ( const QString & text ) const;
  31.         QString textFromValue ( double value ) const;
  32.         QValidator::State validate ( QString & input, int & pos ) const;
  33.         void fixup ( QString & input ) const;
  34.         
  35.         //custom
  36.         void init(int unitIndex);
  37.         void setConstants(const QMap<QString, double>* constants);
  38.         void setNewUnit(int unitIndex);
  39.         double getValue(int unitIndex=0);
  40.         //implemented for backwards compatibility, perhaps we can remove these?
  41. //         void setSingleStepM(int val);
  42.         void setTabAdvance(bool enable);
  43.         
  44.     public slots:
  45.         void setValues(double min, double max, int deci, double val);
  46.         void getValues(double *min, double *max, int *deci, double *val);
  47.     
  48.     protected:
  49.         void setParameters( int s );
  50.         uint m_unitIndex;
  51.         bool m_tabAdvance;
  52.         const QMap<QString, double>* m_constants;
  53.         bool eventFilter ( QObject * watched, QEvent * event );
  54.         
  55.     protected slots:
  56.         void textChanged();
  57.  
  58. };
  59. #endif
  60.