kalarm/lib
timeedit.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef TIMEEDIT_H
00022 #define TIMEEDIT_H
00023
00024 #include <tqdatetime.h>
00025 #include <tqhbox.h>
00026
00027 class ComboBox;
00028 class TimeSpinBox;
00029
00030
00050 class TimeEdit : public TQHBox
00051 {
00052 Q_OBJECT
00053
00054 public:
00059 explicit TimeEdit(TQWidget* parent = 0, const char* name = 0);
00061 bool isReadOnly() const { return mReadOnly; }
00067 virtual void setReadOnly(bool readOnly);
00069 bool isValid() const;
00075 void setValid(bool valid);
00077 int value() const;
00079 TQTime time() const { int m = value(); return TQTime(m/60, m%60); }
00081 bool wrapping() const;
00085 void setWrapping(bool on);
00087 int minValue() const;
00089 int maxValue() const;
00091 TQTime maxTime() const { int mv = maxValue(); return TQTime(mv/60, mv%60); }
00093 void setMinValue(int minutes);
00095 void setMaxValue(int minutes);
00097 void setMaxValue(const TQTime& time) { setMaxValue(time.hour()*60 + time.minute()); }
00098 public slots:
00100 virtual void setValue(int minutes);
00102 void setValue(const TQTime& t) { setValue(t.hour()*60 + t.minute()); }
00103 signals:
00108 void valueChanged(int minutes);
00109
00110 private slots:
00111 void slotValueChanged(int);
00112 void slotAmPmChanged(int item);
00113 private:
00114 void setAmPmCombo(int am, int pm);
00115
00116 TimeSpinBox* mSpinBox;
00117 ComboBox* mAmPm;
00118 int mAmIndex;
00119 int mPmIndex;
00120 bool mReadOnly;
00121 };
00122
00123 #endif // TIMEEDIT_H
|