29 lines
786 B
C++
29 lines
786 B
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <sigc++/connection.h>
|
|
#include <sys/types.h>
|
|
|
|
#include "components/timer.hpp"
|
|
|
|
#include "gtkmm/box.h"
|
|
|
|
class TimerWidget : public Gtk::Box {
|
|
public:
|
|
TimerWidget();
|
|
~TimerWidget();
|
|
void addTimer(const std::string &duration, uint64_t timerId);
|
|
void removeTimer(uint64_t timerId);
|
|
void activateTimer(uint64_t timerId);
|
|
|
|
private:
|
|
std::shared_ptr<TimerService> timerService = TimerService::getInstance();
|
|
bool updatingText = false;
|
|
std::string rawDigits;
|
|
|
|
std::map<uint64_t, std::unique_ptr<Timer>> activeTimers;
|
|
sigc::connection timerSetConnection;
|
|
sigc::connection timerCancelledConnection;
|
|
sigc::connection timerExpiredConnection;
|
|
sigc::connection tickConnection;
|
|
}; |