summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Platform/EventLoopPlugin.h
blob: 9824fed4aa62b8414330e89b78d0f8b58a3ce564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/*
 * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/Forward.h>
#include <LibWeb/Forward.h>

namespace Web::Platform {

class EventLoopPlugin {
public:
    static EventLoopPlugin& the();
    static void install(EventLoopPlugin&);

    virtual ~EventLoopPlugin();

    virtual void spin_until(Function<bool()> goal_condition) = 0;
    virtual void deferred_invoke(Function<void()>) = 0;
    virtual NonnullRefPtr<Timer> create_timer() = 0;
    virtual void quit() = 0;
};

}