aboutsummaryrefslogtreecommitdiff
path: root/plugins/ImageBoard.hpp
blob: 6b287b6ebc36f5def5796b4c9f1e207f96762ec5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#pragma once

#include "Page.hpp"

namespace QuickMedia {
    enum class PostResult {
        OK,
        TRY_AGAIN,
        BANNED,
        //FILE_TOO_LARGE,
        NO_SUCH_FILE,
        FILE_TYPE_NOT_ALLOWED,
        UPLOAD_FAILED,
        ERR
    };

    class ImageBoardThreadPage : public VideoPage {
    public:
        ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id) : VideoPage(program), board_id(std::move(board_id)), thread_id(std::move(thread_id)) {}
        const char* get_title() const override { return ""; }
        PageTypez get_type() const override { return PageTypez::IMAGE_BOARD_THREAD; }

        bool autoplay_next_item() override { return true; }
        std::unique_ptr<RelatedVideosPage> create_related_videos_page(Program *program, const std::string &video_url, const std::string &video_title) override;
        std::unique_ptr<Page> create_channels_page(Program*, const std::string&) override {
            return nullptr;
        }
        std::string get_url() override { return video_url; }
        virtual PluginResult login(const std::string &token, const std::string &pin, std::string &response_msg);
        // If |filepath| is empty then no file is uploaded
        virtual PostResult post_comment(const std::string &captcha_id, const std::string &comment, const std::string &filepath = "") = 0;
        virtual const std::string& get_pass_id();

        const std::string board_id;
        const std::string thread_id;
        std::string video_url;
    };
}