kgameclock.h

Go to the documentation of this file.
00001 /*
00002     This file is part of the KDE games library
00003     Copyright (C) 2007 Mauricio Piacentini (mauricio@tabuleiro.com)
00004     Portions reused from KGameLCDClock
00005     Copyright (C) 2001,2002,2003 Nicolas Hadacek (hadacek@kde.org)
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Library General Public
00009     License version 2 as published by the Free Software Foundation.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
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

Generated on Sun Mar 16 08:02:53 2008 for Libkdegames by  doxygen 1.5.3