Updated the web pages
[chessclock] / classes / chessclock.h
index 4ab58cc..1f8f262 100644 (file)
@@ -87,7 +87,7 @@ public:
 
     /*! Get total time played
       @return Time played in msecs */
-    virtual int getTimePlayed() const;
+    virtual int getTimePlayed();
 
     /*! Set time available
 
@@ -102,10 +102,20 @@ public:
       @param msecs Time to add in msecs */
     void addTime(int msecs);
 
+    /*! Get time played current turn.
+      @return Time in msecs */
+    int currentTurnPlayed();
+
 
 signals:
     void timeOutLoser();
     void turnEnded();
+    /*! Emitted after 30 min played one turn.
+
+      Will cause screen not to keeped lit.
+      @since 1.1.2
+      */
+    void dontEatBattery();
 
 public slots:    
 
@@ -115,13 +125,14 @@ public slots:
     /*! Update clock information, check looser state and refresh */
     virtual void updateClock();
 
-private:
+protected:
     ChessClock* another_; /*! Another player's clock */
 
     bool loser_;        /*! Is player losed because of timeout */
     int turn_;          /*! Current turn */
     RunningStatus status_;
     TurnInformation* currentTurn_;
+    bool dontEatBatteryEmitted_;
 
     int timePlayedBeforeTurn_;    /*! Time played in this game BEFORE this turn msecs */
     int timeAvailableBeforeTurn_; /*! Time available for play BEFORE this turn msecs !*/
@@ -132,7 +143,7 @@ private:
     QTimer updateTimer_;
 
     static const int UPDATEINTERVAL = 1000; /** Clock updating interval in msecs */
-
+    static const int DONTEATBATTERYTIME = 30 * 60 * 1000; /*! Time after screen not to keep lit */
 };
 
 #endif // CHESSCLOCK_H