2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
17 #include "kgamecanvas.h"
19 #include "pixmaploader.h"
20 #include "clickablecanvas.h"
23 class ConstrainedText
;
25 class Clock
: public QObject
, public ClickableCanvas
{
36 KGameCanvasPixmap
* m_background
;
37 ConstrainedText
* m_caption
;
38 ConstrainedText
* m_time_label
;
39 ConstrainedText
* m_player_name
;
40 ConstrainedText
* m_decs
;
42 QPixmap m_active_pixmap
;
43 QPixmap m_inactive_pixmap
;
46 QColor m_inactive_text
;
51 /** the @a PixmapLoader used for controls */
52 PixmapLoader m_controls_loader
;
56 static QString
playerString(const Player
& player
);
59 Clock(int col
, KGameCanvasAbstract
* canvas
);
62 /** returns a reference to the loader used to load controls pixmaps */
63 PixmapLoader
* controlsLoader() { return &m_controls_loader
; }
65 bool running() { return m_running
; }
68 bool active() { return m_active
; }
71 void setPlayer(const Player
& p
);
74 virtual void onMousePress(const QPoint
& pos
, int button
);
75 virtual void onMouseRelease(const QPoint
& /*pos*/, int /*button*/) { }
76 virtual void onMouseMove(const QPoint
& /*pos*/, int /*button*/) { }
78 void resize(int size
);
79 int height() { return m_height
; }
80 void settingsChanged();
86 void labelClicked(int);