00001 /************************************************************************** 00002 00003 Chess Clock 00004 00005 Copyright (c) Arto Hyvättinen 2010 00006 00007 This file is part of Chess Clock software. 00008 00009 Chess Clock is free software: you can redistribute it and/or modify 00010 it under the terms of the GNU General Public License as published by 00011 the Free Software Foundation, either version 3 of the License, or 00012 (at your option) any later version. 00013 00014 Chess Clock is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 GNU General Public License for more details. 00018 00019 00020 **************************************************************************/ 00021 00022 #ifndef CHESSCLOCKWIDGET_H 00023 #define CHESSCLOCKWIDGET_H 00024 00025 #include "chessclock.h" 00026 #include <QPixmap> 00027 #include <QString> 00028 00029 class QVBoxLayout; 00030 class QLabel; 00031 00039 class ChessClockWidget : public ChessClock 00040 { 00041 Q_OBJECT 00042 public: 00043 ChessClockWidget(bool white, QWidget *parent = 0); 00049 void setGreenTime(int msecs); 00050 00051 signals: 00052 00053 public slots: 00054 virtual void repaintClock(); 00055 00056 protected: 00058 virtual void initPictures(); 00060 virtual void initLabels(); 00062 virtual void initTop(); 00065 virtual void initBottom(); 00066 00068 static QString timeString(int msecs); 00069 00070 protected: 00071 00072 QPixmap picActive_; 00073 QPixmap picPassive_; 00074 QPixmap picLoser_; 00075 00076 QLabel* pictureLabel_; 00077 QLabel* timeUsedLabel_; 00078 QLabel* timeAverageLabel_; 00079 QLabel* turnLabel_; 00080 QLabel* turnTimeLabel_; 00081 QLabel* loserLabel_; 00082 QLabel* leftLabel_; 00083 00084 QVBoxLayout* mainLayout; 00085 00086 int greenTime_; 00089 }; 00090 00091 #endif // CHESSCLOCKWIDGET_H