/* Crafter.CppDOM Copyright (C) 2025 Catcrafts Catcrafts.net This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 3.0 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ export module Crafter.CppDOM:HtmlElement; import std; import :BindingsExport; import :BindingsImport; import :EventTypes; namespace Crafter { export class HtmlElement { public: void* const ptr; std::vector clickHandlers; std::vector mouseOverHandlers; std::vector mouseOutHandlers; std::vector mouseMoveHandlers; std::vector mouseDownHandlers; std::vector mouseUpHandlers; std::vector focusHandlers; std::vector blurHandlers; std::vector keyDownHandlers; std::vector keyUpHandlers; std::vector keyPressHandlers; std::vector changeHandlers; std::vector submitHandlers; std::vector inputHandlers; std::vector resizeHandlers; std::vector scrollHandlers; std::vector contextMenuHandlers; std::vector dragStartHandlers; std::vector dragEndHandlers; std::vector dropHandlers; std::vector dragOverHandlers; std::vector dragEnterHandlers; std::vector dragLeaveHandlers; std::vector wheelHandlers; HtmlElement(const std::string_view id); HtmlElement(const std::string_view id, const std::string_view html); void SetInnerHTML(const std::string_view html); void SetStyle(const std::string_view style); void SetProperty(const std::string_view property, const std::string_view value); void AddClass(const std::string_view className); void RemoveClass(const std::string_view className); void ToggleClass(const std::string_view className); bool HasClass(const std::string_view className); std::int32_t AddClickListener(std::function callback); void RemoveClickListener(std::int32_t id); std::int32_t AddMouseOverListener(std::function callback); void RemoveMouseOverListener(std::int32_t id); std::int32_t AddMouseOutListener(std::function callback); void RemoveMouseOutListener(std::int32_t id); std::int32_t AddMouseMoveListener(std::function callback); void RemoveMouseMoveListener(std::int32_t id); std::int32_t AddMouseDownListener(std::function callback); void RemoveMouseDownListener(std::int32_t id); std::int32_t AddMouseUpListener(std::function callback); void RemoveMouseUpListener(std::int32_t id); std::int32_t AddFocusListener(std::function callback); void RemoveFocusListener(std::int32_t id); std::int32_t AddBlurListener(std::function callback); void RemoveBlurListener(std::int32_t id); std::int32_t AddKeyDownListener(std::function callback); void RemoveKeyDownListener(std::int32_t id); std::int32_t AddKeyUpListener(std::function callback); void RemoveKeyUpListener(std::int32_t id); std::int32_t AddKeyPressListener(std::function callback); void RemoveKeyPressListener(std::int32_t id); std::int32_t AddChangeListener(std::function callback); void RemoveChangeListener(std::int32_t id); std::int32_t AddSubmitListener(std::function callback); void RemoveSubmitListener(std::int32_t id); std::int32_t AddInputListener(std::function callback); void RemoveInputListener(std::int32_t id); std::int32_t AddResizeListener(std::function callback); void RemoveResizeListener(std::int32_t id); std::int32_t AddScrollListener(std::function callback); void RemoveScrollListener(std::int32_t id); std::int32_t AddContextMenuListener(std::function callback); void RemoveContextMenuListener(std::int32_t id); std::int32_t AddDragStartListener(std::function callback); void RemoveDragStartListener(std::int32_t id); std::int32_t AddDragEndListener(std::function callback); void RemoveDragEndListener(std::int32_t id); std::int32_t AddDropListener(std::function callback); void RemoveDropListener(std::int32_t id); std::int32_t AddDragOverListener(std::function callback); void RemoveDragOverListener(std::int32_t id); std::int32_t AddDragEnterListener(std::function callback); void RemoveDragEnterListener(std::int32_t id); std::int32_t AddDragLeaveListener(std::function callback); void RemoveDragLeaveListener(std::int32_t id); std::int32_t AddWheelListener(std::function callback); void RemoveWheelListener(std::int32_t id); ~HtmlElement(); }; }