summaryrefslogtreecommitdiff
path: root/src/main_window.hpp
blob: 98af5a23a5b8a0a7eda7e9de36836fd390f49cee (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
58
59
60
61
62
63
64
65
66
#ifndef MAIN_WINDOW_HPP
#define MAIN_WINDOW_HPP

#include "archive.hpp"
#include "getsuyomi.hpp"

#include <QtWidgets>
#include <fud_status.hpp>

namespace getsuyomi {

constexpr const char* AppVendor = "libfud";

constexpr const char* AppName = "getsuyomi";

constexpr const char* AppVersionString = "1.0.0";

class GetsuyomiApp : public QMainWindow {
    Q_OBJECT

  public:
    GetsuyomiApp();
    ~GetsuyomiApp() = default;
    GetsuyomiApp(const GetsuyomiApp&) = delete;
    GetsuyomiApp(GetsuyomiApp&&) = delete;
    GetsuyomiApp& operator=(const GetsuyomiApp&) = delete;
    GetsuyomiApp& operator=(GetsuyomiApp&&) = delete;

    fud::FudStatus setup();

  private:
    /* Private methods */
    void createActions();
    void createMenus();
    void createToolBar();

    /* Private data */
    Getsuyomi* m_getsuyomi{nullptr};

    QAction* m_openFile{nullptr};
    QAction* m_openDirectory{nullptr};
    QAction* m_quitAction{nullptr};
    QAction* m_nextAction{nullptr};
    QAction* m_backAction{nullptr};

    QMenu* m_menuBar{nullptr};
    QToolBar* m_toolBar{nullptr};

    QString m_lastOpenedDirectory{};

  private slots:
    void openFile();
    void openDirectory();
    void quit();

    void readSettings();
    void writeSettings();
    void closeEvent(QCloseEvent* event) override;

    void next();
    void back();
};

} // namespace getsuyomi

#endif