#pragma once

#include "enums/InputEnums.hpp"
#include "Vector2.hpp"

namespace TSE
{
    class ICursorHandler
    {
    private:
        bool Enabled = false;

    public:
        ICursorHandler() = default;
        ~ICursorHandler();

        bool enabled() const;
        void Enable();
        void Disable();

        inline virtual void OnMouseButtonDown(const MouseBtn& btn, const Modifier& mods) { };
        inline virtual void OnMouseButtonUp(const MouseBtn& btn, const Modifier& mods) { };
        inline virtual void OnMouseButtonHold(const MouseBtn& btn, const Modifier& mods) { };

        inline virtual void OnMousePosition(const Vector2& pos) { };
        inline virtual void OnMouseScroll(const Vector2& delta) { };

    private:
        static void onMouseButtonDown( ICursorHandler* handler, const MouseBtn& btn, const Modifier& mods);
        static void onMouseButtonUp( ICursorHandler* handler, const MouseBtn& btn, const Modifier& mods);
        static void onMouseButtonHold( ICursorHandler* handler, const MouseBtn& btn, const Modifier& mods);

        static void onMousePosition( ICursorHandler* handler, const Vector2& pos);
        static void onMouseScroll( ICursorHandler* handler, const Vector2& delta);
    };
} // namespace TSE
