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