libkdegames
kgameclock.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
00019
00020
00021
00022 #ifndef __KGAMECLOCK_H
00023 #define __KGAMECLOCK_H
00024
00025 #include <QtCore/QObject>
00026 #include <libkdegames_export.h>
00027
00028 class KGameClockPrivate;
00029
00033 class KDEGAMES_EXPORT KGameClock : public QObject
00034 {
00035 Q_OBJECT
00036 public:
00037 enum ClockType { HourMinSec = 0, MinSecOnly };
00038
00042 explicit KGameClock(QObject *parent = 0, ClockType clocktype = HourMinSec);
00043
00044 virtual ~KGameClock();
00045
00049 uint seconds() const;
00050
00054 QString timeString() const;
00055
00059 void setTime(uint seconds);
00060
00064 void setTime(const QString &s);
00065
00069 void showTime();
00070
00071 Q_SIGNALS:
00072 void timeChanged(const QString &);
00073
00074 public Q_SLOTS:
00078 virtual void restart();
00079
00083 virtual void pause();
00084
00088 virtual void resume();
00089
00090 protected Q_SLOTS:
00091 virtual void timeoutClock();
00092
00093 private:
00094 friend class KGameClockPrivate;
00095 KGameClockPrivate *const d;
00096
00097 Q_DISABLE_COPY(KGameClock)
00098 };
00099
00100 #endif