-
Notifications
You must be signed in to change notification settings - Fork 3
/
pomodoro.h
65 lines (46 loc) · 1.13 KB
/
pomodoro.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef POMODORO_H
#define POMODORO_H
#include <QObject>
#include <QTimer>
#include <QMap>
class Pomodoro : public QObject
{
Q_OBJECT
public:
enum PomodoroState {
STOPPED,
POMODORO,
SHORT_BREAK,
LONG_BREAK
};
Q_ENUM(PomodoroState)
public:
explicit Pomodoro(QObject *parent = nullptr);
PomodoroState currentState();
int nextTimeout();
int pomodoroDuration() { return pomodoro_duration; }
int shortBreakDuration() { return short_break_duration; }
int longBreakDuration() { return long_break_duration; }
int pomodoroPerLongBreak() { return pomodoro_per_long_break; }
signals:
void stateTransition(PomodoroState oldState, PomodoroState newState);
public slots:
void start();
void stop();
void resetToDefaults();
void setPomodoroDuration(int minutes);
void setShortBreakDuration(int minutes);
void setLongBreakDuration(int minutes);
void setPomodoroPerLongBreak(int count);
private slots:
void timeout();
private:
QTimer* timer;
PomodoroState state;
int pomodoro_count;
int pomodoro_duration;
int short_break_duration;
int long_break_duration;
int pomodoro_per_long_break;
};
#endif // POMODORO_H