#pragma once

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

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

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

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

        inline virtual void OnKeyDown(const Key& key, const Modifier& mods) { };
        inline virtual void OnKeyUp(const Key& key, const Modifier& mods) { };
        inline virtual void OnKeyHold(const Key& key, const Modifier& mods) { };
        inline virtual void OnChar(const std::string& c) { };

    private:
        static void onKeyDown(IKeyInputHandler* handler, const Key& key, const Modifier& mods);
        static void onKeyUp(IKeyInputHandler* handler, const Key& key, const Modifier& mods);
        static void onKeyHold(IKeyInputHandler* handler, const Key& key, const Modifier& mods);
        static void onChar(IKeyInputHandler* handler, const std::string& c);
    };
} // namespace TSE
