diff options
author | dec05eba <dec05eba@protonmail.com> | 2021-07-19 19:28:45 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-07-19 19:28:45 +0200 |
commit | cd4d2e98c34ed413ca164dbad61ba19636377f77 (patch) | |
tree | 69a1ab7f19acc4b9abf016025921efed3b80c2a9 /plugins | |
parent | e671784144174c4fceaa6df3737ba9b4de4a6c63 (diff) |
Add hotexamples
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/HotExamples.hpp | 36 |
1 files changed, 36 insertions, 0 deletions
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<Tab> &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<Tab> &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<Tab>&) override { return PluginResult::OK; } + bool submit_is_async() override { return false; } + private: + std::string title; + }; +}
\ No newline at end of file |