aboutsummaryrefslogtreecommitdiff
path: root/plugins/ImageBoard.hpp
blob: 6f2a27616cafee5ef2410666b267c88f3b0594f0 (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
#pragma once

#include "Page.hpp"

namespace QuickMedia {
    enum class PostResult {
        OK,
        TRY_AGAIN,
        BANNED,
        ERR
    };

    class ImageBoardThreadPage : public Page {
    public:
        ImageBoardThreadPage(Program *program, std::string board_id, std::string thread_id, std::vector<std::string> cached_media_urls) : Page(program), board_id(std::move(board_id)), thread_id(std::move(thread_id)), cached_media_urls(std::move(cached_media_urls)) {}
        const char* get_title() const override { return ""; }
        PluginResult submit(const std::string &title, const std::string &url, std::vector<Tab> &result_tabs) override {
            (void)title;
            (void)url;
            (void)result_tabs;
            return PluginResult::ERR;
        }

        bool is_image_board_thread_page() const override { return true; }

        virtual BodyItems get_related_media(const std::string &url) override;
        virtual PluginResult login(const std::string &token, const std::string &pin, std::string &response_msg);
        virtual PostResult post_comment(const std::string &captcha_id, const std::string &comment) = 0;
        virtual const std::string& get_pass_id();

        const std::string board_id;
        const std::string thread_id;
        const std::vector<std::string> cached_media_urls;
    };
}