diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-05-31 18:03:57 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-05-31 18:05:01 +0200 |
commit | 34fef69fd468f695b3b5817da6a9980ac7b5860d (patch) | |
tree | 9b0f50279b269e6e1a429bd313d24491ff9cc4e7 /plugins | |
parent | 68a2660da9ea4c660feda5d8569a8f43108964ec (diff) |
Add dmenu option
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Dmenu.hpp | 20 | ||||
-rw-r--r-- | plugins/Plugin.hpp | 2 |
2 files changed, 22 insertions, 0 deletions
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<std::string> 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; |