2021-02-03 22:47:50 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-02-03 22:47:50 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <AK/String.h>
|
|
|
|
#include <LibJS/Heap/Handle.h>
|
2021-06-27 21:48:34 +02:00
|
|
|
#include <LibJS/Runtime/FunctionObject.h>
|
2021-02-03 22:47:50 +01:00
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
|
|
struct EventHandler {
|
|
|
|
EventHandler()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
EventHandler(String s)
|
|
|
|
: string(move(s))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2021-06-27 21:48:34 +02:00
|
|
|
EventHandler(JS::Handle<JS::FunctionObject> c)
|
2021-02-03 22:47:50 +01:00
|
|
|
: callback(move(c))
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
String string;
|
2021-06-27 21:48:34 +02:00
|
|
|
JS::Handle<JS::FunctionObject> callback;
|
2021-02-03 22:47:50 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|