mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-03 22:59:13 +00:00
Everywhere: Hoist the Libraries folder to the top-level
This commit is contained in:
parent
950e819ee7
commit
93712b24bf
Notes:
github-actions[bot]
2024-11-10 11:51:52 +00:00
Author: https://github.com/trflynn89
Commit: 93712b24bf
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2256
Reviewed-by: https://github.com/sideshowbarker
4547 changed files with 104 additions and 113 deletions
45
Libraries/LibWeb/Platform/Timer.h
Normal file
45
Libraries/LibWeb/Platform/Timer.h
Normal file
|
@ -0,0 +1,45 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefCounted.h>
|
||||
#include <LibJS/Heap/Cell.h>
|
||||
|
||||
namespace Web::Platform {
|
||||
|
||||
class Timer : public JS::Cell {
|
||||
JS_CELL(Timer, JS::Cell);
|
||||
|
||||
public:
|
||||
static JS::NonnullGCPtr<Timer> create(JS::Heap&);
|
||||
static JS::NonnullGCPtr<Timer> create_repeating(JS::Heap&, int interval_ms, JS::GCPtr<JS::HeapFunction<void()>> timeout_handler);
|
||||
static JS::NonnullGCPtr<Timer> create_single_shot(JS::Heap&, int interval_ms, JS::GCPtr<JS::HeapFunction<void()>> timeout_handler);
|
||||
|
||||
virtual ~Timer();
|
||||
|
||||
virtual void start() = 0;
|
||||
virtual void start(int interval_ms) = 0;
|
||||
virtual void restart() = 0;
|
||||
virtual void restart(int interval_ms) = 0;
|
||||
virtual void stop() = 0;
|
||||
|
||||
virtual void set_active(bool) = 0;
|
||||
|
||||
virtual bool is_active() const = 0;
|
||||
virtual int interval() const = 0;
|
||||
virtual void set_interval(int interval_ms) = 0;
|
||||
|
||||
virtual bool is_single_shot() const = 0;
|
||||
virtual void set_single_shot(bool) = 0;
|
||||
|
||||
JS::GCPtr<JS::HeapFunction<void()>> on_timeout;
|
||||
|
||||
protected:
|
||||
virtual void visit_edges(JS::Cell::Visitor&) override;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue