mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-09 17:44:56 +09:00
LibCore: Move LibGUI/GTimer to LibCore/CTimer.
This commit is contained in:
parent
667e678aa6
commit
47a2982119
Notes:
sideshowbarker
2024-07-19 14:44:45 +09:00
Author: https://github.com/awesomekling
Commit: 47a2982119
5 changed files with 14 additions and 14 deletions
|
@ -1,32 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <LibCore/CObject.h>
|
||||
#include <AK/Function.h>
|
||||
|
||||
class GTimer final : public CObject {
|
||||
public:
|
||||
explicit GTimer(CObject* parent = nullptr);
|
||||
virtual ~GTimer() override;
|
||||
|
||||
void start();
|
||||
void start(int interval);
|
||||
void stop();
|
||||
|
||||
bool is_active() const { return m_active; }
|
||||
int interval() const { return m_interval; }
|
||||
void set_interval(int interval) { m_interval = interval; }
|
||||
|
||||
bool is_single_shot() const { return m_single_shot; }
|
||||
void set_single_shot(bool single_shot) { m_single_shot = single_shot; }
|
||||
|
||||
Function<void()> on_timeout;
|
||||
|
||||
virtual const char* class_name() const override { return "GTimer"; }
|
||||
|
||||
private:
|
||||
virtual void timer_event(CTimerEvent&) override;
|
||||
|
||||
bool m_active { false };
|
||||
bool m_single_shot { false };
|
||||
int m_interval { 0 };
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue