1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 20:15:07 +00:00
serenity/Userland/DevTools/HackStudio/Tool.h
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00

43 lines
865 B
C++

/*
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Noncopyable.h>
#include <LibGUI/Forward.h>
namespace HackStudio {
class FormEditorWidget;
class Tool {
AK_MAKE_NONCOPYABLE(Tool);
AK_MAKE_NONMOVABLE(Tool);
public:
virtual ~Tool() { }
virtual void on_mousedown(GUI::MouseEvent&) = 0;
virtual void on_mouseup(GUI::MouseEvent&) = 0;
virtual void on_mousemove(GUI::MouseEvent&) = 0;
virtual void on_keydown(GUI::KeyEvent&) = 0;
virtual void on_second_paint(GUI::Painter&, GUI::PaintEvent&) { }
virtual const char* class_name() const = 0;
virtual void attach() { }
virtual void detach() { }
protected:
explicit Tool(FormEditorWidget& editor)
: m_editor(editor)
{
}
FormEditorWidget& m_editor;
};
}