aboutsummaryrefslogtreecommitdiff
path: root/include/Tab.hpp
blob: b277f88c9376bb5a2a9a9d45d252a88b73a458e4 (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
#pragma once

#include <vector>
#include <memory>

namespace QuickMedia {
    class Body;
    class Page;
    class SearchBar;

    struct LoginInputs {
        std::vector<std::unique_ptr<SearchBar>> inputs;
        int focused_input = 0;
        bool needs_refresh = false;
    };

    struct Tab {
        Tab(std::unique_ptr<Body> body, std::unique_ptr<Page> page, std::unique_ptr<SearchBar> search_bar, LoginInputs login_inputs = {}) : 
            body(std::move(body)), page(std::move(page)), search_bar(std::move(search_bar)), login_inputs(std::move(login_inputs)) {}

        std::unique_ptr<Body> body;
        std::unique_ptr<Page> page; // Only null when current page has |is_single_page()| set to true
        std::unique_ptr<SearchBar> search_bar; // Nullable
        LoginInputs login_inputs;
    };
}