tderandr
ktimerdialog.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _KTIMERDIALOG_H_
00022 #define _KTIMERDIALOG_H_
00023
00024 #include <kdialogbase.h>
00025
00026 class TQTimer;
00027 class TQHBox;
00028 class TQProgressBar;
00029 class TQLabel;
00030
00045 class KTimerDialog : public KDialogBase
00046 {
00047 Q_OBJECT
00048
00049 public:
00050
00057 enum TimerStyle
00058 {
00059 CountDown,
00060 CountUp,
00061 Manual
00062 };
00063
00070 KTimerDialog( int msec, TimerStyle style=CountDown, TQWidget *parent=0,
00071 const char *name=0, bool modal=true,
00072 const TQString &caption=TQString::null,
00073 int buttonMask=Ok|Apply|Cancel, ButtonCode defaultButton=Ok,
00074 bool separator=false,
00075 const KGuiItem &user1=KGuiItem(),
00076 const KGuiItem &user2=KGuiItem(),
00077 const KGuiItem &user3=KGuiItem() );
00078
00082 ~KTimerDialog();
00083
00087 virtual void show();
00088
00092 void setRefreshInterval( int msec );
00093
00098 int timeoutButton() const;
00099
00104 void setTimeoutButton( ButtonCode newButton );
00105
00109 int timerStyle() const;
00110
00114 void setTimerStyle( TimerStyle newStyle );
00115
00120 void setMainWidget( TQWidget *widget );
00121
00122 signals:
00126 void timerTimeout();
00127
00128 public slots:
00132 int exec();
00133
00134 private slots:
00138 void slotUpdateTime( bool update = true );
00139
00143 void slotInternalTimeout();
00144
00145 private:
00149 void setupLayout();
00150
00151 TQTimer *totalTimer;
00152 TQTimer *updateTimer;
00153 int msecRemaining, updateInterval, msecTotal;
00154
00155 ButtonCode buttonOnTimeout;
00156 TimerStyle tStyle;
00157
00158 TQHBox *timerWidget;
00159 TQProgressBar *timerProgress;
00160 TQLabel *timerLabel;
00161 TQVBox *mainWidget;
00162
00163 class KTimerDialogPrivate;
00164 KTimerDialogPrivate *d;
00165 };
00166
00167 #endif
00168
00169
00170