X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Ftimer.h;h=061475db026fba8ed974c7aa1d18eda57ec35978;hb=c4037ede3790b9ec97001d9c9202cec1003f18e1;hp=26c6f6a051707853d214b7a16b4467b25c6f9e4d;hpb=d703fb607c0291912211a5d43cdd04b60b6e87c6;p=kitchenalert diff --git a/src/timer.h b/src/timer.h index 26c6f6a..061475d 100644 --- a/src/timer.h +++ b/src/timer.h @@ -1,7 +1,7 @@ /************************************************************************** KitchenAlert - Copyright (C) 2010 Heli Hyvättinen + Copyright (C) 2010-2011 Heli Hyvättinen This file is part of KitchenAlert. @@ -34,13 +34,13 @@ #include - +#include "alertsound.h" /*! The timer class of KitchenAlert' @author Heli Hyvättinen - @date 2010-06-26 - @version 0.09 + @date 2011-02-10 + @version 0.2.1 The timer class of KitchenAlert. @@ -52,28 +52,56 @@ class Timer : public QObject public: explicit Timer(QObject *parent = 0); - int getOriginalTimeInSeconds(); + /*! Returns the original time in seconds + When the alert restarts, it is set to this time. + */ + int getOriginalTimeInSeconds(); + + /*! Sets the original time in seconds */ void setOriginalTimeInSeconds(int seconds); + /*! Returns the time remaining before the alert in seconds */ int getRemainingTimeInSeconds(); + /*! Returns the alert text */ QString getAlertText(); + + /*! Sets the alert text */ void setAlertText(QString text); + /*! Returns whether the timer is alerting */ bool isAlerting(); signals: - + /*! Emitted when the remaining time in the timer has changed */ void remainingTimeChanged(); + + /*! Emitted when the timer alerts */ void alert(QModelIndex indexOfAlerter); public slots: + /*! The internal QTimer is connected to this slot */ void secondPassed(); + + /*! Start the timer */ void start(); + + /*! Stop the timer*/ void stop(); + + /*! Snooze the timer + Currently sets the timer to alert again in two minutes. + */ void snooze(); + /*! Switches to use the default sound (and saves it to settings */ + void enableDefaultSound(); + + /*! Changes the sound file used and saves it to settings */ + void changeAlertSound(QString filename); + + private: @@ -85,6 +113,8 @@ private: QModelIndex whereAmI(); + AlertSound alertSound_; + }; #endif // TIMER_H