summaryrefslogtreecommitdiffstats
path: root/kmahjongg/GameTimer.h
blob: 10d97e134bdb6a0cff6bd5f0bab2ac600f31ef69 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* -------------------------------------------------------------------------
   -- kmahjongg timer. Based on a slightly modified verion of the QT demo --
   -- program dclock. Copyright as shown below.                           --
   ------------------------------------------------------------------------- */

/****************************************************************************
** $Id$
**
** Copyright (C) 1992-1998 Troll Tech AS.  All rights reserved.
**
** This file is part of an example program for Qt.  This example
** program may be used, distributed and modified without limitation.
**
*****************************************************************************/

#ifndef KM_GAME_TIMER 
#define KM_GAME_TIMER 

#include <tqlcdnumber.h>
#include <tqdatetime.h>

enum TimerMode {running = -53 , stopped= -54 , paused = -55};

class GameTimer: public TQLCDNumber 
{
    Q_OBJECT
public:
    GameTimer( TQWidget *parent=0, const char *name=0 );

    int toInt(); 
    TQString toString() {return theTimer.toString();}	
    void fromString(const char *);

protected:					// event handlers
    void	timerEvent( TQTimerEvent * );
 
public slots:
    void start();
    void stop();
    void pause();


private slots:					// internal slots
    void	showTime();

private:					// internal data
    bool	showingColon;
    QTime	theTimer;
    TimerMode   timerMode;
};


#endif