aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/HotExamples.hpp36
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