summaryrefslogtreecommitdiff
path: root/src/bookmouse.hpp
blob: b2a3a5a02b243e1423e75988661aa303cabecfe0 (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
#ifndef BOOKMOUSE_HPP
#define BOOKMOUSE_HPP

#include "archive.hpp"

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

namespace bookmouse {

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

class Bookmouse : public QWidget {
    Q_OBJECT

  public:
    friend class BookmouseApp;
    Bookmouse();

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

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

    QLayout* m_layout{nullptr};

    Archive* m_archive{nullptr};

    PageLayout m_pageLayout{PageLayout::Single};

    QLabel m_pageLeft{};
    QLabel m_pageRight{};

    size_t m_pageNumber{0};
};

} // namespace bookmouse

#endif