#ifndef client_hh_INCLUDED #define client_hh_INCLUDED #include "keys.hh" #include "completion.hh" #include "utils.hh" #include "string.hh" namespace Kakoune { class Editor; class Context; using MenuCallback = std::function; using PromptCallback = std::function; using KeyCallback = std::function; class ClientMode; enum class InsertMode : unsigned; class Client : public SafeCountable { public: Client(); ~Client(); void insert(Context& context, InsertMode 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; }; struct prompt_aborted {}; } #endif // client_hh_INCLUDED