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
00035 class KDEGAMES_EXPORT KGameClock : public QObject
00036 {
00037 Q_OBJECT
00038 public:
00039 enum ClockType { HourMinSec = 0, MinSecOnly };
00040
00044 explicit KGameClock(QObject *parent = 0, ClockType clocktype = HourMinSec);
00045
00046 virtual ~KGameClock();
00047
00051 uint seconds() const;
00052
00056 QString timeString() const;
00057
00061 void setTime(uint seconds);
00062
00066 void setTime(const QString &s);
00067
00071 void showTime();
00072
00073 Q_SIGNALS:
00074 void timeChanged(const QString &);
00075
00076 public Q_SLOTS:
00080 virtual void restart();
00081
00085 virtual void pause();
00086
00090 virtual void resume();
00091
00092 protected Q_SLOTS:
00093 virtual void timeoutClock();
00094
00095 private:
00096 friend class KGameClockPrivate;
00097 KGameClockPrivate *const d;
00098
00099 Q_DISABLE_COPY(KGameClock)
00100 };
00101
00102 #endif