aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-04-12 14:21:21 +0200
committerdec05eba <dec05eba@protonmail.com>2021-04-12 14:21:21 +0200
commitbb7ad686d202bfe513104546cb2d77e6720d62a3 (patch)
tree97f23d0992e51921ecff134aa9949dc5d9c04a59 /plugins
parente904091c8f64f60a5abbb6434cf3506aea59a2b3 (diff)
Add manganelos
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Manganelos.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/Manganelos.hpp b/plugins/Manganelos.hpp
new file mode 100644
index 0000000..ede2712
--- /dev/null
+++ b/plugins/Manganelos.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include "Manga.hpp"
+#include <functional>
+
+namespace QuickMedia {
+ class ManganelosSearchPage : public Page {
+ public:
+ ManganelosSearchPage(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 get_page(const std::string &str, int page, BodyItems &result_items) override;
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ sf::Vector2i get_thumbnail_max_size() override { return sf::Vector2i(101, 141); };
+ };
+
+ class ManganelosChaptersPage : public MangaChaptersPage {
+ public:
+ ManganelosChaptersPage(Program *program, std::string manga_name, std::string manga_url) : MangaChaptersPage(program, std::move(manga_name), std::move(manga_url)) {}
+ PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override;
+ protected:
+ bool extract_id_from_url(const std::string &url, std::string &manga_id) const override;
+ const char* get_service_name() const override { return "manganelos"; }
+ };
+
+ class ManganelosImagesPage : public MangaImagesPage {
+ public:
+ ManganelosImagesPage(Program *program, std::string manga_name, std::string chapter_name, std::string url) : MangaImagesPage(program, std::move(manga_name), std::move(chapter_name), std::move(url)) {}
+
+ ImageResult get_number_of_images(int &num_images) override;
+ ImageResult for_each_page_in_chapter(PageCallback callback) override;
+
+ const char* get_service_name() const override { return "manganelos"; }
+ private:
+ ImageResult get_image_urls_for_chapter(const std::string &url);
+ };
+} \ No newline at end of file