From 77ed51898157d99112be7550471ec06e32344c9e Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 11 Oct 2020 21:35:37 +0200 Subject: Refactor plugin into seperate pages TODO: Readd 4chan login page, manganelo creators page, autocomplete --- plugins/Pornhub.hpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'plugins/Pornhub.hpp') diff --git a/plugins/Pornhub.hpp b/plugins/Pornhub.hpp index 188a68e..195845f 100644 --- a/plugins/Pornhub.hpp +++ b/plugins/Pornhub.hpp @@ -1,17 +1,28 @@ #pragma once -#include "Plugin.hpp" +#include "Page.hpp" namespace QuickMedia { - class Pornhub : public Plugin { + class PornhubSearchPage : public Page { public: - Pornhub() : Plugin("pornhub") {} - SuggestionResult update_search_suggestions(const std::string &text, BodyItems &result_items) override; + PornhubSearchPage(Program *program) : Page(program) {} + const char* get_title() const override { return "All"; } + bool search_is_filter() override { return false; } + SearchResult search(const std::string &str, BodyItems &result_items) override; + PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; + }; + + class PornhubVideoPage : public Page { + public: + PornhubVideoPage(Program *program) : Page(program) {} + const char* get_title() const override { return ""; } + PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override { + (void)title; + (void)url; + (void)result_tabs; + return PluginResult::ERR; + } BodyItems get_related_media(const std::string &url) override; - bool search_suggestions_has_thumbnails() const override { return true; } - bool search_results_has_thumbnails() const override { return false; } - int get_search_delay() const override { return 500; } - bool search_suggestion_is_search() const override { return true; } - Page get_page_after_search() const override { return Page::VIDEO_CONTENT; } + bool is_video_page() const override { return true; } }; } \ No newline at end of file -- cgit v1.2.3