summaryrefslogtreecommitdiff
path: root/src/getsuyomi.hpp
blob: abf8a723051c24323f57aec000dac378ac91c254 (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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef GETSUYOMI_HPP
#define GETSUYOMI_HPP

#include "archive.hpp"

#include <QtWidgets>
#include <cstdint>
#include <vector>

namespace getsuyomi {

enum class PageLayout : uint8_t {
    Single,
    Dual,
    Manga
};

class Getsuyomi : public QWidget {
    Q_OBJECT

  public:
    friend class GetsuyomiApp;
    Getsuyomi();
    Getsuyomi(const Getsuyomi&) = delete;
    Getsuyomi(Getsuyomi&&) = delete;
    ~Getsuyomi();
    Getsuyomi& operator=(const Getsuyomi&) = delete;
    Getsuyomi& operator=(Getsuyomi&&) = delete;

  public slots:
    void setArchive(Archive* archive);
    void next();
    void back();
    void setPageLayout(PageLayout newPageLayout);

  private:
    void setPages();
    void setPagesNormal();
    void setPagesDual();
    void setPagesManga();
    void setPages(QLabel& label1, QLabel& label2);

    QBoxLayout* m_layout{nullptr};

    Archive* m_archive{nullptr};

    PageLayout m_pageLayout{PageLayout::Single};

    QLabel m_pageLeft{};
    QLabel m_pageRight{};

    size_t m_pageNumber{0};
};

} // namespace getsuyomi

#endif