From 34fef69fd468f695b3b5817da6a9980ac7b5860d Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 31 May 2020 18:03:57 +0200 Subject: Add dmenu option --- plugins/Dmenu.hpp | 20 ++++++++++++++++++++ plugins/Plugin.hpp | 2 ++ 2 files changed, 22 insertions(+) create mode 100644 plugins/Dmenu.hpp (limited to 'plugins') diff --git a/plugins/Dmenu.hpp b/plugins/Dmenu.hpp new file mode 100644 index 0000000..84614cc --- /dev/null +++ b/plugins/Dmenu.hpp @@ -0,0 +1,20 @@ +#pragma once + +#include "Plugin.hpp" + +namespace QuickMedia { + class Dmenu : public Plugin { + public: + Dmenu(); + bool search_is_filter() override { return true; } + bool search_suggestions_has_thumbnails() const override { return false; } + bool search_results_has_thumbnails() const override { return false; } + int get_search_delay() const override { return 0; } + bool search_suggestion_is_search() const override { return true; } + Page get_page_after_search() const override { return Page::EXIT; } + PluginResult get_front_page(BodyItems &result_items) override; + SearchResult search(const std::string &text, BodyItems &result_items) override; + private: + std::vector stdin_data; + }; +} \ No newline at end of file diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp index b430d57..be70684 100644 --- a/plugins/Plugin.hpp +++ b/plugins/Plugin.hpp @@ -43,6 +43,8 @@ namespace QuickMedia { virtual bool is_image_board() { return false; } virtual bool is_manga() { return false; } + // Return true if searching should update the search result (which could be a remote server search) or filter the existing list locally + virtual bool search_is_filter() { return false; } virtual PluginResult get_front_page(BodyItems &result_items) { (void)result_items; return PluginResult::OK; -- cgit v1.2.3