aboutsummaryrefslogtreecommitdiff
path: root/plugins/Page.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Page.hpp')
-rw-r--r--plugins/Page.hpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/Page.hpp b/plugins/Page.hpp
index c61fd6d..9d5bade 100644
--- a/plugins/Page.hpp
+++ b/plugins/Page.hpp
@@ -29,6 +29,9 @@ namespace QuickMedia {
virtual bool search_is_filter() { return true; }
// This show be overriden if search_is_filter is overriden to return false
virtual SearchResult search(const std::string &str, BodyItems &result_items) { (void)str; (void)result_items; return SearchResult::ERR; }
+ // If this returns true then |submit_suggestion| is called when submitting the selected item instead of |submit|
+ // and |submit| is called when submitting the response of |submit_suggestion|
+ virtual bool search_is_suggestion() { return false; }
// Return empty |result_tabs| and PluginResult::OK to do nothing; which is useful for implementing custom actions on item submit
virtual PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) {
@@ -40,6 +43,12 @@ namespace QuickMedia {
// Override and return false to make submit run in the main (ui) thread
virtual bool submit_is_async() { return true; }
virtual bool clear_search_after_submit() { return false; }
+ virtual PluginResult submit_suggestion(const std::string &title, const std::string &url, BodyItems &result_items) {
+ (void)title;
+ (void)url;
+ (void)result_items;
+ return PluginResult::ERR;
+ }
// Note: If pagination is done by fetching the next page until we get to |page|, then the "current page" should be reset everytime |search| is called.
// Note: the first page is 0
virtual PluginResult get_page(const std::string &str, int page, BodyItems &result_items) { (void)str; (void)page; (void)result_items; return PluginResult::OK; }
@@ -110,7 +119,7 @@ namespace QuickMedia {
virtual PageTypez get_type() const override { return PageTypez::VIDEO; }
virtual bool autoplay_next_item() { return false; }
virtual BodyItems get_related_media(const std::string &url) { (void)url; return {}; }
- virtual std::unique_ptr<Page> create_search_page(Program *program, int &search_delay) { (void)program; (void)search_delay; return nullptr; }
+ virtual bool create_search_page(Program *program, Tab &tab) { (void)program; (void)tab; return false; }
virtual std::unique_ptr<Page> create_comments_page(Program *program) { (void)program; return nullptr; }
// Return nullptr if the service doesn't support related videos page
virtual std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program) = 0;