aboutsummaryrefslogtreecommitdiff
path: root/plugins/AniList.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/AniList.hpp')
-rw-r--r--plugins/AniList.hpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/plugins/AniList.hpp b/plugins/AniList.hpp
new file mode 100644
index 0000000..3d71f5c
--- /dev/null
+++ b/plugins/AniList.hpp
@@ -0,0 +1,51 @@
+#pragma once
+
+#include "Page.hpp"
+
+namespace QuickMedia {
+ class AniListSearchPage : public Page {
+ public:
+ AniListSearchPage(Program *program) : Page(program) {}
+ const char* get_title() const override { return "Search for anime or manga"; }
+ bool search_is_filter() override { return false; }
+ bool submit_is_async() const 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;
+ PluginResult get_page(const std::string &str, int page, BodyItems &result_items) override;
+ private:
+ SearchResult search_page(const std::string &str, int page, BodyItems &result_items);
+ };
+
+ class AniListRelatedPage : public LazyFetchPage {
+ public:
+ AniListRelatedPage(Program *program, std::string id) : LazyFetchPage(program), id(std::move(id)) {}
+ const char* get_title() const override { return "Related"; }
+ 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 id;
+ };
+
+ class AniListDetailsPage : public LazyFetchPage {
+ public:
+ AniListDetailsPage(Program *program, std::string id) : LazyFetchPage(program), id(std::move(id)) {}
+ 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 id;
+ };
+
+ class AniListRecommendationsPage : public LazyFetchPage {
+ public:
+ AniListRecommendationsPage(Program *program, std::string id) : LazyFetchPage(program), id(std::move(id)) {}
+ 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 id;
+ };
+} \ No newline at end of file