mirror of
https://github.com/mawww/kakoune.git
synced 2024-11-24 16:15:38 +03:00
44 lines
1010 B
C++
44 lines
1010 B
C++
#ifndef filter_registry_h_INCLUDED
|
|
#define filter_registry_h_INCLUDED
|
|
|
|
#include <unordered_map>
|
|
|
|
#include "string.hh"
|
|
#include "filter.hh"
|
|
#include "utils.hh"
|
|
#include "completion.hh"
|
|
#include "memoryview.hh"
|
|
#include "idvaluemap.hh"
|
|
|
|
namespace Kakoune
|
|
{
|
|
|
|
class Window;
|
|
|
|
typedef memoryview<String> FilterParameters;
|
|
|
|
typedef std::function<FilterAndId (Window& window,
|
|
const FilterParameters& params)> FilterFactory;
|
|
|
|
class FilterRegistry : public Singleton<FilterRegistry>
|
|
{
|
|
public:
|
|
void register_factory(const String& name,
|
|
const FilterFactory& factory);
|
|
|
|
void add_filter_to_window(Window& window,
|
|
const String& factory_name,
|
|
const FilterParameters& parameters);
|
|
|
|
CandidateList complete_filter(const String& prefix,
|
|
size_t cursor_pos);
|
|
|
|
private:
|
|
idvaluemap<String, FilterFactory> m_factories;
|
|
};
|
|
|
|
}
|
|
|
|
#endif // filter_registry_h_INCLUDED
|
|
|