aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Dmenu.hpp20
-rw-r--r--plugins/Plugin.hpp2
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;