kstars
timeunitbox.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef TIMEUNITBOX_H
00019 #define TIMEUNITBOX_H
00020
00021 #include <qvbox.h>
00022 #include <qwidget.h>
00023
00024 #define ALLUNITS 8
00025 #define DAYUNITS 5
00026
00044 class QPushButton;
00045
00046 class TimeUnitBox : public QVBox {
00047 Q_OBJECT
00048 public:
00050 TimeUnitBox(QWidget *parent=0, const char *name=0, bool daysonly = false);
00052 ~TimeUnitBox();
00054 int unitValue();
00055
00059 int getUnitValue( int );
00060
00064 void setValue( int value ) { Value = value; }
00067 int value() const { return Value; }
00068
00071 void setMinValue( int minValue ) { MinimumValue = minValue; }
00074 void setMaxValue( int maxValue ) { MaximumValue = maxValue; }
00075
00078 int minValue() const { return MinimumValue; }
00081 int maxValue() const { return MaximumValue; }
00082
00083 bool daysOnly() const { return DaysOnly; }
00084 void setDaysOnly( bool daysonly );
00085
00086 signals:
00087 void valueChanged(int);
00088
00089 private slots:
00092 void increase();
00095 void decrease();
00096
00097 private:
00098 bool DaysOnly;
00099 QPushButton *UpButton, *DownButton;
00100 int MinimumValue, MaximumValue, Value, UnitStep[ ALLUNITS ];
00101 };
00102
00103 #endif