1 /**************************************************************************
5 Copyright (c) Arto Hyvättinen 2010
6 Changes for porting to Harmattan(c) Heli Hyvättinen 2011
8 This file is part of Chess Clock software.
10 Chess Clock is free software: you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation, either version 3 of the License, or
13 (at your option) any later version.
15 Chess Clock is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
21 **************************************************************************/
23 #ifndef CLOCKSWIDGET_H
24 #define CLOCKSWIDGET_H
32 class TurnInformation;
34 class ScreenLitKeeper;
38 /*! Widget with two clocks
40 @author Arto Hyvättinen (& Heli Hyvättinen)
45 Central widget of Chess Clock.
46 Needed to create new ClocksWidget to
50 class ClocksWidget : public QWidget
54 ClocksWidget(ChessClock* white, ChessClock* black, QWidget *parent = 0);
56 bool isPlayStarted() { return (status_!=Welcome); }
59 //In Harmattan (PageStackWindow) no mouseReleaseEvents are received. Changed to use mousePressEvent instead
60 void mousePressEvent(QMouseEvent *event);
61 bool eventFilter(QObject *obj, QEvent *event); //same with eventFilter
65 void TurnFinished(TurnInformation* turnInfo);
66 void ClickedWhenStopped();
67 void unPaused(); //For Harmattan, to inform QML
74 /*! Not to keep screen lit */
82 QLabel* welcomeLabel_;
83 QToolButton* pauseButton_;
84 ScreenLitKeeper* keeper_;
87 Stopped /*! Not running */,
96 QTime delayTimer_; /*! To avoid double clicks */
101 static int const CLICKDELAY = 1500 ; /*! Click delay in msecs */
107 #endif // CLOCKSWIDGET_H