#pragma once #include #include #include namespace lumacs { class EditorCore; // Forward declaration /// @brief Manages the recording and playback of keyboard macros. class MacroManager { public: explicit MacroManager(EditorCore& core); /// @brief Starts recording a new keyboard macro. Clears any existing macro. void start_kbd_macro(); /// @brief Stops recording the current macro or executes the last recorded macro. void end_kbd_macro_or_call(); /// @brief Records a key sequence if macro recording is currently active. /// @param key_sequence The key sequence to record. void record_key_sequence(const std::string& key_sequence); /// @brief Checks if macro recording is currently active. [[nodiscard]] bool is_recording_macro() const noexcept { return recording_macro_; } /// @brief Retrieves the last recorded macro's key sequences. [[nodiscard]] const std::vector& get_last_macro() const noexcept { return last_macro_; } private: EditorCore& core_; std::vector current_macro_; std::vector last_macro_; bool recording_macro_ = false; }; } // namespace lumacs