#pragma once

#include <AK/Utf16String.h>
#include <LibJS/Forward.h>
#include <LibJS/Runtime/NativeFunction.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/Value.h>
#include <LibWeb/Bindings/InterfaceObject.h>

namespace Web::Bindings {

struct HTMLButtonElementConstructor {
public:
    static void initialize(JS::Realm&, JS::NativeFunction&);
    static JS::ThrowCompletionOr<GC::Ref<JS::Object>> construct(InterfaceConstructor&, JS::FunctionObject&);

private:
};

struct HTMLButtonElementPrototype {
public:
    static void initialize(JS::Realm&, JS::Object&);
    static void define_unforgeable_attributes(JS::Realm&, JS::Object&);

private:
    JS_DECLARE_NATIVE_FUNCTION(command_getter);
    JS_DECLARE_NATIVE_FUNCTION(command_setter);
    JS_DECLARE_NATIVE_FUNCTION(command_for_element_getter);
    JS_DECLARE_NATIVE_FUNCTION(command_for_element_setter);
    JS_DECLARE_NATIVE_FUNCTION(disabled_getter);
    JS_DECLARE_NATIVE_FUNCTION(disabled_setter);
    JS_DECLARE_NATIVE_FUNCTION(form_getter);
    JS_DECLARE_NATIVE_FUNCTION(form_action_getter);
    JS_DECLARE_NATIVE_FUNCTION(form_action_setter);
    JS_DECLARE_NATIVE_FUNCTION(form_enctype_getter);
    JS_DECLARE_NATIVE_FUNCTION(form_enctype_setter);
    JS_DECLARE_NATIVE_FUNCTION(form_method_getter);
    JS_DECLARE_NATIVE_FUNCTION(form_method_setter);
    JS_DECLARE_NATIVE_FUNCTION(form_no_validate_getter);
    JS_DECLARE_NATIVE_FUNCTION(form_no_validate_setter);
    JS_DECLARE_NATIVE_FUNCTION(form_target_getter);
    JS_DECLARE_NATIVE_FUNCTION(form_target_setter);
    JS_DECLARE_NATIVE_FUNCTION(name_getter);
    JS_DECLARE_NATIVE_FUNCTION(name_setter);
    JS_DECLARE_NATIVE_FUNCTION(type_getter);
    JS_DECLARE_NATIVE_FUNCTION(type_setter);
    JS_DECLARE_NATIVE_FUNCTION(value_getter);
    JS_DECLARE_NATIVE_FUNCTION(value_setter);
    JS_DECLARE_NATIVE_FUNCTION(will_validate_getter);
    JS_DECLARE_NATIVE_FUNCTION(validity_getter);
    JS_DECLARE_NATIVE_FUNCTION(validation_message_getter);
    JS_DECLARE_NATIVE_FUNCTION(labels_getter);
    JS_DECLARE_NATIVE_FUNCTION(popover_target_element_getter);
    JS_DECLARE_NATIVE_FUNCTION(popover_target_element_setter);
    JS_DECLARE_NATIVE_FUNCTION(popover_target_action_getter);
    JS_DECLARE_NATIVE_FUNCTION(popover_target_action_setter);
    JS_DECLARE_NATIVE_FUNCTION(check_validity);
    JS_DECLARE_NATIVE_FUNCTION(report_validity);
    JS_DECLARE_NATIVE_FUNCTION(set_custom_validity);
};

enum class ButtonTypeState : u8 {
    Submit,
    Reset,
    Button,
};

JS::ThrowCompletionOr<ButtonTypeState> convert_to_idl_value_for_button_type_state(JS::VM&, JS::Value);

Utf16String idl_enum_to_string(ButtonTypeState);

} // namespace Web::Bindings
