Changeset View
Changeset View
Standalone View
Standalone View
src/Config.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2020 Carson Black <uhhadd@gmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU Library General Public License as | ||||
6 | * published by the Free Software Foundation; either version 2, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU Library General Public License for more details | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU Library General Public | ||||
15 | * License along with this program; if not, write to the | ||||
16 | * Free Software Foundation, Inc., | ||||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
18 | */ | ||||
19 | | ||||
20 | #pragma once | ||||
21 | | ||||
22 | #include <QObject> | ||||
23 | #include <QSettings> | ||||
24 | | ||||
25 | class Config : public QObject | ||||
26 | { | ||||
27 | Q_OBJECT | ||||
28 | | ||||
29 | #ifndef Q_OS_ANDROID | ||||
30 | Q_PROPERTY(int windowX WRITE setWindowX MEMBER m_windowX NOTIFY coordinatesChanged) | ||||
31 | Q_PROPERTY(int windowY WRITE setWindowY MEMBER m_windowY NOTIFY coordinatesChanged) | ||||
32 | Q_PROPERTY(int windowWidth WRITE setWindowWidth MEMBER m_windowWidth NOTIFY coordinatesChanged) | ||||
33 | Q_PROPERTY(int windowHeight WRITE setWindowHeight MEMBER m_windowHeight NOTIFY coordinatesChanged) | ||||
34 | #endif | ||||
35 | Q_PROPERTY(QString lastPage WRITE setLastPage MEMBER m_lastPage NOTIFY lastPageChanged) | ||||
36 | | ||||
37 | public: | ||||
38 | explicit Config(QObject *parent = nullptr); | ||||
39 | ~Config(); | ||||
40 | | ||||
41 | #ifndef Q_OS_ANDROID | ||||
42 | void setWindowX(int); | ||||
43 | void setWindowY(int); | ||||
44 | void setWindowWidth(int); | ||||
45 | void setWindowHeight(int); | ||||
46 | Q_SIGNAL void coordinatesChanged(); | ||||
47 | #endif | ||||
48 | | ||||
49 | void setLastPage(const QString&); | ||||
50 | Q_SIGNAL void lastPageChanged(); | ||||
51 | | ||||
52 | private: | ||||
53 | #ifndef Q_OS_ANDROID | ||||
54 | int m_windowX, m_windowY, m_windowWidth, m_windowHeight; | ||||
55 | #endif | ||||
56 | QString m_lastPage; | ||||
57 | QSettings* m_settings; | ||||
58 | }; | ||||
59 | No newline at end of file |