/* * Copyright (c) 2021, Tim Flynn * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::Layout { class RadioButton : public LabelableNode { public: RadioButton(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr); virtual ~RadioButton() override; virtual void paint(PaintContext&, PaintPhase) override; const HTML::HTMLInputElement& dom_node() const { return static_cast(LabelableNode::dom_node()); } HTML::HTMLInputElement& dom_node() { return static_cast(LabelableNode::dom_node()); } private: virtual bool wants_mouse_events() const override { return true; } virtual void handle_mousedown(Badge, const Gfx::IntPoint&, unsigned button, unsigned modifiers) override; virtual void handle_mouseup(Badge, const Gfx::IntPoint&, unsigned button, unsigned modifiers) override; virtual void handle_mousemove(Badge, const Gfx::IntPoint&, unsigned buttons, unsigned modifiers) override; virtual void handle_associated_label_mousedown(Badge