Changeset View
Changeset View
Standalone View
Standalone View
src/rsitimer.h
Show All 17 Lines | 1 | /* | |||
---|---|---|---|---|---|
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | 18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||
19 | 19 | | |||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef RSITimer_H | 22 | #ifndef RSITimer_H | ||
23 | #define RSITimer_H | 23 | #define RSITimer_H | ||
24 | 24 | | |||
25 | #include <QThread> | 25 | #include <QThread> | ||
26 | #include <QVector> | ||||
26 | #include <memory> | 27 | #include <memory> | ||
27 | 28 | | |||
28 | #include "rsiglobals.h" | | |||
29 | #include "rsitimercounter.h" | 29 | #include "rsitimercounter.h" | ||
30 | #include "rsiidletime.h" | 30 | #include "rsiidletime.h" | ||
31 | 31 | | |||
32 | /** | 32 | /** | ||
33 | * @class RSITimer | 33 | * @class RSITimer | ||
34 | * This class controls the timings and arranges the maximizing | 34 | * This class controls the timings and arranges the maximizing | ||
35 | * and minimizing of the widget. | 35 | * and minimizing of the widget. | ||
36 | * @author Tom Albers <toma.org> | 36 | * @author Tom Albers <toma.org> | ||
Show All 14 Lines | 43 | public: | |||
51 | // Check whether the timer is suspended. | 51 | // Check whether the timer is suspended. | ||
52 | bool isSuspended() const { return m_state == TimerState::Suspended; } | 52 | bool isSuspended() const { return m_state == TimerState::Suspended; } | ||
53 | 53 | | |||
54 | int tinyLeft() const { return m_tinyBreakCounter->counterLeft(); }; | 54 | int tinyLeft() const { return m_tinyBreakCounter->counterLeft(); }; | ||
55 | 55 | | |||
56 | int bigLeft() const { return m_bigBreakCounter->counterLeft(); }; | 56 | int bigLeft() const { return m_bigBreakCounter->counterLeft(); }; | ||
57 | 57 | | |||
58 | public slots: | 58 | public slots: | ||
59 | | ||||
59 | /** | 60 | /** | ||
60 | Reads the configuration and restarts the timer with slotRestart. | 61 | Reads the configuration and restarts the timer with slotRestart. | ||
61 | */ | 62 | */ | ||
62 | void updateConfig( bool doRestart = false ); | 63 | void updateConfig( bool doRestart = false ); | ||
63 | 64 | | |||
64 | /** | 65 | /** | ||
65 | Stops the timer activity. This does not imply resetting counters. | 66 | Stops the timer activity. This does not imply resetting counters. | ||
66 | */ | 67 | */ | ||
▲ Show 20 Lines • Show All 90 Lines • ▼ Show 20 Line(s) | 114 | signals: | |||
157 | */ | 158 | */ | ||
158 | void tinyBreakSkipped(); | 159 | void tinyBreakSkipped(); | ||
159 | 160 | | |||
160 | /** | 161 | /** | ||
161 | Indicates a bigBreak is skipped because user was enough idle | 162 | Indicates a bigBreak is skipped because user was enough idle | ||
162 | */ | 163 | */ | ||
163 | void bigBreakSkipped(); | 164 | void bigBreakSkipped(); | ||
164 | 165 | | |||
166 | void startLongBreak(); | ||||
167 | void endLongBreak(); | ||||
168 | void startShortBreak(); | ||||
169 | void endShortBreak(); | ||||
170 | | ||||
165 | private: | 171 | private: | ||
166 | std::unique_ptr<RSIIdleTime> m_idleTimeInstance; | 172 | std::unique_ptr<RSIIdleTime> m_idleTimeInstance; | ||
167 | 173 | | |||
168 | bool m_usePopup; | 174 | bool m_usePopup; | ||
169 | bool m_useIdleTimers; | 175 | bool m_useIdleTimers; | ||
170 | QVector<int> m_intervals; | 176 | QVector<int> m_intervals; | ||
171 | 177 | | |||
172 | enum class TimerState { | 178 | enum class TimerState { | ||
Show All 34 Lines |