/* * Copyright (c) 2020, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include namespace Web::Layout { class CheckBox : public LabelableNode { public: CheckBox(DOM::Document&, HTML::HTMLInputElement&, NonnullRefPtr); virtual ~CheckBox() 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