-
Notifications
You must be signed in to change notification settings - Fork 0
/
AppConfiguration.hpp
98 lines (70 loc) · 2.75 KB
/
AppConfiguration.hpp
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#ifndef APPCONFIGURATION_HPP
#define APPCONFIGURATION_HPP
#include "core/Global.hpp"
#include <QObject>
#include <QSettings>
#include <QSize>
#include <QCamera>
class AppConfiguration : public QObject
{
Q_OBJECT
Q_PROPERTY(QString fotozorInstanceName READ fotozorInstanceName)
Q_PROPERTY(QString introductionText READ introductionText)
Q_PROPERTY(QString savingText READ savingText)
Q_PROPERTY(QString savingTitle READ savingTitle)
Q_PROPERTY(QString printingText READ printingText)
Q_PROPERTY(QString printingTitle READ printingTitle)
Q_PROPERTY(uint savingTime READ savingTime)
Q_PROPERTY(qreal zoom READ zoom WRITE setZoom NOTIFY zoomChanged)
Q_PROPERTY(qreal colorTemp READ colorTemp WRITE setColorTemp NOTIFY colorTempChanged)
Q_PROPERTY(QSize resolution READ resolution WRITE setResolution NOTIFY resolutionChanged)
Q_PROPERTY(QCamera::Position cameraPosition READ cameraPosition WRITE setCameraPosition NOTIFY cameraPositionChanged)
Q_PROPERTY(qreal bottomMarginRatio READ bottomMarginRatio WRITE setBottomMarginRatio NOTIFY bottomMarginRatioChanged)
Q_PROPERTY(qreal scaleFactor READ scaleFactor WRITE setScaleFactor NOTIFY scaleFactorChanged)
Q_PROPERTY(qreal rotationAngle READ rotationAngle WRITE setRotationAngle NOTIFY rotationAngleChanged)
Q_PROPERTY(bool settingsFileExists READ settingsFileExists)
public:
explicit AppConfiguration(QObject* a_Parent = nullptr);
bool logsEnabled() const;
bool settingsFileExists() const;
QString savingTitle() const;
QString savingText() const;
QString printingTitle() const;
QString printingText() const;
QString introductionText() const;
QString fotozorInstanceName() const;
uint savingTime() const;
qreal zoom() const;
void setZoom(qreal a_Value);
qreal colorTemp() const;
void setColorTemp(qreal a_Value);
QSize resolution() const;
void setResolution(const QSize& a_Value);
QCamera::Position cameraPosition() const;
void setCameraPosition(const QCamera::Position& a_Value);
qreal bottomMarginRatio() const;
void setBottomMarginRatio(qreal a_Value);
qreal scaleFactor() const;
void setScaleFactor(qreal a_Value);
qreal rotationAngle() const;
void setRotationAngle(qreal a_Value);
public slots:
signals:
void zoomChanged();
void colorTempChanged();
void resolutionChanged();
void cameraPositionChanged();
void bottomMarginRatioChanged();
void scaleFactorChanged();
void rotationAngleChanged();
private:
mutable QSettings m_Settings;
};
//==============================
// non-member methods
//==============================
void initLogs();
//==============================
// inline methods implementation
//==============================
#endif // APPCONFIGURATION_HPP