#pragma once #include class Widget; class Timer { public: Timer(Widget* owner); ~Timer(); void Start(int timeoutMilliseconds, bool repeat = true); void Stop(); std::function FuncExpired; private: Widget* OwnerObj = nullptr; Timer* PrevTimerObj = nullptr; Timer* NextTimerObj = nullptr; void* TimerId = nullptr; friend class Widget; };