Everywhere: Hoist the Libraries folder to the top-level

This commit is contained in:
Timothy Flynn 2024-11-09 12:25:08 -05:00 committed by Andreas Kling
commit 93712b24bf
Notes: github-actions[bot] 2024-11-10 11:51:52 +00:00
4547 changed files with 104 additions and 113 deletions

View 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;
};
}