From cd4d2e98c34ed413ca164dbad61ba19636377f77 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Mon, 19 Jul 2021 19:28:45 +0200 Subject: Add hotexamples --- plugins/HotExamples.hpp | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 plugins/HotExamples.hpp (limited to 'plugins') diff --git a/plugins/HotExamples.hpp b/plugins/HotExamples.hpp new file mode 100644 index 0000000..154f1ab --- /dev/null +++ b/plugins/HotExamples.hpp @@ -0,0 +1,36 @@ +#pragma once + +#include "Page.hpp" + +namespace QuickMedia { + void hot_examples_front_page_fill(BodyItems &body_items); + + class HotExamplesLanguageSelectPage : public Page { + public: + HotExamplesLanguageSelectPage(Program *program) : Page(program) {} + const char* get_title() const override { return "Select language"; } + PluginResult submit(const std::string &title, const std::string &url, std::vector &result_tabs) override; + bool submit_is_async() override { return false; } + }; + + class HotExamplesSearchPage : public Page { + public: + HotExamplesSearchPage(Program *program, const std::string &language) : Page(program), language(language) {} + const char* get_title() const override { return "Select result"; } + 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; + private: + std::string language; + }; + + class HotExamplesCodeExamplesPage : public Page { + public: + HotExamplesCodeExamplesPage(Program *program, std::string title) : Page(program), title(std::move(title)) {} + const char* get_title() const override { return title.c_str(); } + PluginResult submit(const std::string&, const std::string&, std::vector&) override { return PluginResult::OK; } + bool submit_is_async() override { return false; } + private: + std::string title; + }; +} \ No newline at end of file -- cgit v1.2.3