aboutsummaryrefslogtreecommitdiff
path: root/plugins/MyAnimeList.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/MyAnimeList.hpp')
-rw-r--r--plugins/MyAnimeList.hpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/MyAnimeList.hpp b/plugins/MyAnimeList.hpp
new file mode 100644
index 0000000..c88e94f
--- /dev/null
+++ b/plugins/MyAnimeList.hpp
@@ -0,0 +1,36 @@
+#pragma once
+
+#include "Page.hpp"
+
+namespace QuickMedia {
+ class MyAnimeListSearchPage : public Page {
+ public:
+ MyAnimeListSearchPage(Program *program) : Page(program) {}
+ const char* get_title() const override { return "Search for anime or manga"; }
+ 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<Tab> &result_tabs) override;
+ };
+
+ class MyAnimeListDetailsPage : public LazyFetchPage {
+ public:
+ MyAnimeListDetailsPage(Program *program, std::string url) : LazyFetchPage(program), url(std::move(url)) {}
+ const char* get_title() const override { return "Details"; }
+ bool submit_is_async() const override { return false; }
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ PluginResult lazy_fetch(BodyItems &result_items) override;
+ private:
+ std::string url;
+ };
+
+ class MyAnimeListRecommendationsPage : public LazyFetchPage {
+ public:
+ MyAnimeListRecommendationsPage(Program *program, std::string url) : LazyFetchPage(program), url(std::move(url)) {}
+ const char* get_title() const override { return "Recommendations"; }
+ bool submit_is_async() const override { return false; }
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ PluginResult lazy_fetch(BodyItems &result_items) override;
+ private:
+ std::string url;
+ };
+} \ No newline at end of file