#ifndef client_hh_INCLUDED #define client_hh_INCLUDED #include "keys.hh" #include "completion.hh" #include "utils.hh" #include "string.hh" #include "window.hh" namespace Kakoune { class Editor; class Context; using MenuCallback = std::function; using PromptCallback = std::function; using KeyCallback = std::function; class ClientMode; class Client : public SafeCountable { public: Client(); ~Client(); void insert(Editor& editor, IncrementalInserter::Mode mode); void repeat_last_insert(Context& context); void prompt(const String& prompt, Completer completer, PromptCallback callback, Context& context); void menu(const memoryview& choices, MenuCallback callback, Context& context); void on_next_key(KeyCallback callback); void handle_next_input(Context& context); private: friend class ClientMode; std::unique_ptr m_mode; std::pair> m_last_insert; }; struct prompt_aborted {}; } #endif // client_hh_INCLUDED