Added ChessClockWizard class
[chessclock] / classes / chessclockwidget.h
1  /**************************************************************************
2
3     Chess Clock
4
5     Copyright (c) Arto Hyvättinen 2010
6
7     This file is part of Chess Clock software.
8
9     Chess Clock is free software: you can redistribute it and/or modify
10     it under the terms of the GNU General Public License as published by
11     the Free Software Foundation, either version 3 of the License, or
12     (at your option) any later version.
13
14     Chess Clock is distributed in the hope that it will be useful,
15     but WITHOUT ANY WARRANTY; without even the implied warranty of
16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17     GNU General Public License for more details.
18
19
20 **************************************************************************/
21
22 #ifndef CHESSCLOCKWIDGET_H
23 #define CHESSCLOCKWIDGET_H
24
25 #include "chessclock.h"
26 #include <QPixmap>
27 #include <QString>
28
29 class QVBoxLayout;
30 class QLabel;
31
32 /*!  Simple chess clock widget
33
34   @author Arto Hyvättinen
35   @date 2010-08-14
36
37
38   */
39 class ChessClockWidget : public ChessClock
40 {
41     Q_OBJECT
42 public:
43     ChessClockWidget(bool white, QWidget *parent = 0);
44
45 signals:
46
47 public slots:
48     virtual void repaintClock();
49
50 protected:
51     /*! Init pictures from resources */
52     virtual void initPictures();
53     /*! Init QLabels */
54     virtual void initLabels();
55     /*! Init top: picture, details, loser mark */
56     virtual void initTop();
57     /*! Init time left in bottom.
58       Override to make different bottom area */
59     virtual void initBottom();
60
61     /*! Convert msecs to h:mm:ss QString */
62     QString timeString(int msecs);
63
64 protected:
65
66     QPixmap picActive_;
67     QPixmap picPassive_;
68     QPixmap picLoser_;
69
70     QLabel* pictureLabel_;
71     QLabel* timeUsedLabel_;
72     QLabel* timeAverageLabel_;
73     QLabel* turnLabel_;
74     QLabel* loserLabel_;
75     QLabel* leftLabel_;
76
77     QVBoxLayout* mainLayout;
78
79
80 };
81
82 #endif // CHESSCLOCKWIDGET_H