aboutsummaryrefslogtreecommitdiff
path: root/plugins/Plugin.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2019-08-02 20:08:27 +0200
committerdec05eba <dec05eba@protonmail.com>2019-08-02 20:08:27 +0200
commit65cf7681a04f2511db8c7829e9828b53a6676c88 (patch)
tree6e7db509cf2bce4a10fa6d8bc89a9eae88d893fa /plugins/Plugin.hpp
parent109c797d7c89223c9eed07dc322448b5c5fe3373 (diff)
Convert to sfml, starting on manganelo and youtube
Diffstat (limited to 'plugins/Plugin.hpp')
-rw-r--r--plugins/Plugin.hpp38
1 files changed, 38 insertions, 0 deletions
diff --git a/plugins/Plugin.hpp b/plugins/Plugin.hpp
new file mode 100644
index 0000000..bc518a8
--- /dev/null
+++ b/plugins/Plugin.hpp
@@ -0,0 +1,38 @@
+#pragma once
+
+#include <string>
+#include <vector>
+#include <memory>
+
+namespace QuickMedia {
+ class BodyItem {
+ public:
+ BodyItem(const std::string &_title): title(_title) {
+
+ }
+
+ std::string title;
+ std::string cover_url;
+ };
+
+ enum class SearchResult {
+ OK,
+ ERR,
+ NET_ERR
+ };
+
+ enum class DownloadResult {
+ OK,
+ ERR,
+ NET_ERR
+ };
+
+ class Plugin {
+ public:
+ virtual ~Plugin() = default;
+
+ virtual SearchResult search(const std::string &text, std::vector<std::unique_ptr<BodyItem>> &result_items) = 0;
+ protected:
+ DownloadResult download_to_string(const std::string &url, std::string &result);
+ };
+} \ No newline at end of file